System.Data.OleDb.OleDbException: Syntax error in UPDATE statement.

M

Mark Sandfox

I have wrote this code just about every way I can think of and I still get
the above error. One thing I noticed was when I reduce the amount of fields
to be updated to about half it works, but that is not a solution. The code
is below and I give great thanks to anyone who can help me here.

Note: I have "" the memo fields thinking that it may have been a special
character issue but I still get the same resulting error message.



Sub Update_Info(Sender as Object, E as EventArgs)
Dim cnMemberUpdate as OleDbConnection
Dim strUpdate as string
Dim cmdUpdate as OleDbCommand

cnMemberUpdate = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=C:\Inetpub\wwwroot\WaucondaChamber\fpdb\members list and
yp.mdb")
strUpdate = "Update MemberList Set Company=@company, Contact=@contact,
Address=@address, City=@city, State=@state, Zip=@zip, Phone=@phone,
Fax=@fax, Email=@email, Domain=@domain, Description=@description,
B2BDescription=@b2bdescription, Keywords=@keywords, UserName=@username,
Password=@password Where ID = " & tbID.Text

cmdUpdate = New OleDbCommand(strUpdate, cnMemberUpdate)
cmdUpdate.Parameters.Add("@company",tbCompany.Text)
cmdUpdate.Parameters.Add("@contact",tbContact.Text)
cmdUpdate.Parameters.Add("@address",tbAddress.Text)
cmdUpdate.Parameters.Add("@city",tbCity.Text)
cmdUpdate.Parameters.Add("@state",tbState.Text)
cmdUpdate.Parameters.Add("@zip",tbZipCode.Text)
cmdUpdate.Parameters.Add("@phone",tbTelephone.Text)
cmdUpdate.Parameters.Add("@fax",tbFax.Text)
cmdUpdate.Parameters.Add("@email","")
cmdUpdate.Parameters.Add("@domain", "")
cmdUpdate.Parameters.Add("@description", "")
cmdUpdate.Parameters.Add("@b2bdescription", "")
cmdUpdate.Parameters.Add("@username",tbUserName.Text)
cmdUpdate.Parameters.Add("@password",tbPassword.Text)


cnMemberUpdate.Open()
cmdUpdate.ExecuteNonQuery()
cnMemberUpdate.Close()


Response.Redirect("Update_Confirmation.htm")
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top