Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

"UPDATE [RevsionRecords] SET [VPoME] = 'Yes', [DoTSE] = '', [DoM] = 'Yes', [CI] = '', [MoMC] = '', [MoMP] = '', [MoRD] = '', [FAA] = '', [TechWriter] = 'Yes', WHERE [RevisionNum] = '2015-100')"



I'm getting a syntax error trying to update access database from vb.net The string above is the actual update command being passed by vb.net. Is the issue in passing the empty values? In this case my code has only 3 fields to populate the string value of "yes" so the other values are null. what am I doing wrong here?
Posted
Comments
ZurdoDev 24-Nov-15 9:51am    
The error will normally tell you where the syntax issue is. However, see solutions for the answer.

You have to delete the comma between [TechWriter] = 'Yes' and the WHERE clause:
SQL
UPDATE [RevsionRecords] SET [VPoME] = 'Yes', [DoTSE] = '', [DoM] = 'Yes', [CI] = '', [MoMC] = '', [MoMP] = '', [MoRD] = '', [FAA] = '', [TechWriter] = 'Yes' WHERE [RevisionNum] = '2015-100')
 
Share this answer
 
Comments
Member 12117439 24-Nov-15 9:58am    
If I remove the comma I get the error "Could not perform this task because Extra ) in query expression '[RevisionNum] = '2015-100')'.
phil.o 24-Nov-15 10:02am    
Then get rid of the last parenthesis...
It does not look like you are trying to understand the error messages that are presented to you; that's a huge issue.
Member 12117439 24-Nov-15 10:06am    
just a matter of looking at to many lines of code for too long. for some reason I was stuck in the concept that I needed the ). I need new glasses :)

Thank You
phil.o 24-Nov-15 10:07am    
:)
There is an unnecessary comma before the WHERE clause and a closing parenthesis just before the end...
 
Share this answer
 
where is the opening bracket " ( " in the code
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900