Need a little tweak to code please help Delete funtion
I sence victory been battling the this code for 2 days now.
the code i have generated is
strsql = "delete from cg_security_user_right where user_id= " & TextBox1.Text & " role_id=" & TextBox2.Text & ""
it comes up with this error
Syntax error (missing operator) in query expression 'user_id= 2 role_id=1'.
how do i get past this please
Thank yo so much
Related Article: Need Help In Gym application code
is a VB.NET discussion thread by navachaitanya that has 6 replies, was last updated 10 months ago and has been tagged with the keywords: date, expire, gym.
Farhan_B
Junior Poster in Training
66 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
try:
strsql = "delete from cg_security_user_right where user_id = '" & TextBox1.Text & "' role_id = '" & TextBox2.Text & "'"
Mitja Bonca
Posting Maven
2,561 posts since May 2009
Reputation Points: 642
Solved Threads: 486
Skill Endorsements: 15
no its still coming with the same error :{
Farhan_B
Junior Poster in Training
66 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
im seriously scratching my head i cannot think of the thing it can b any suggestions
Farhan_B
Junior Poster in Training
66 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Right after the line where you create the query, please add the following
MsgBox(strsql)
and post the results for us to see.
Reverend Jim
Illigitimae non carborundum
3,750 posts since Aug 2010
Reputation Points: 585
Solved Threads: 470
Skill Endorsements: 33
This is a simple Delete query created in Access 2007. I do not believe you need the extra double quote you had in your original post or the single quotes I saw in another unless your user_id and role_id are strings and not integers.
Dim sql As String = "DELETE * FROM [Copy Of tbl_Inventory]" & _
"WHERE ((([Copy Of tbl_Inventory].Item_ID)=181));"
Phasma
Junior Poster in Training
81 posts since Nov 2008
Reputation Points: 21
Solved Threads: 21
Skill Endorsements: 0