Question Sql UPDATE syntax error

Raz

Member
Joined
Jun 7, 2010
Messages
11
Programming Experience
Beginner
Hi

Can you please check why I am getting UPDATE syntax error with This SQL:

sql = "UPDATE tblDatabasesPath SET FileToEcnrypMain ='" & txtFileToEncryptMain1.Text & "', FileToDecrypMain = '" & txtFileToDecMain1.Text & _
"', FileToEcnrypSecurity ='" & txtFileToEncryptSecurity1.Text & " ', FileToDecrypSecurity = '" & txtFileToDecryptSecurity1.Text & "', " & "Encrypt-DecryptKey = '" & txtConPassEncrypt1.Text & "' " & "WHERE ID=" & ("1")

I use VB.net 2005 and Access database

Many thanks
 
Don't use string concatenation to insert values into SQL code. Always use parameters. Follow the Blog link in my signature and check out my post on ADO.NET Parameters and fix your code and then we can revisit it if the problem persists.
 
Back
Top