473,398 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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

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\mem bers 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.Te xt)
cmdUpdate.Parameters.Add("@password",tbPassword.Te xt)
cnMemberUpdate.Open()
cmdUpdate.ExecuteNonQuery()
cnMemberUpdate.Close()
Response.Redirect("Update_Confirmation.htm")
End Sub
Nov 18 '05 #1
1 5130
Fixed problem = was reserved word issue. ACK
"Mark Sandfox" <Ma**@RestlessFox.com> wrote in message
news:70********************@newssvr28.news.prodigy .com...
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\mem bers 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.Te xt)
cmdUpdate.Parameters.Add("@password",tbPassword.Te xt)
cnMemberUpdate.Open()
cmdUpdate.ExecuteNonQuery()
cnMemberUpdate.Close()
Response.Redirect("Update_Confirmation.htm")
End Sub

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: G.Esmeijer | last post by:
Friends, The following code works fin. BUT... after a >> couple times<< this code is used is a class it comes with an error saying unhandled System.Data.OleDb.OleDbException' occurred in...
0
by: silesius | last post by:
I've been using VS 2003 to develop a webapplication using C#. Today I exported the application to a remote webserver I begun experiencing problems. It's a simple application that retrieves some...
1
by: T8 | last post by:
I have a asp.net (framework 1.1) site interfacing against SQL 2000. It runs like a charm 99% of the time but once in a while I get the following "unspecified error". Sometimes it would resolve by...
2
by: Joe | last post by:
Hello All, I am trying to insert a record in the MS Access DB and for some reason I cannot get rid of error message, System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. ...
0
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at...
5
by: petro | last post by:
Hello all, My asp.net web application works on my machine but I get the following error on our test web server, There is only one oracle home on the test server. Does anyone know how to resolve...
0
by: dim mzeura via .NET 247 | last post by:
(Type your message here) -------------------------------- From: dim mzeura I have the same problem too. Please help! System.Data.OleDb.OleDbException: Syntax error (missing operator) in...
1
by: Joe | last post by:
Hello All, I am trying to insert a record in the MS Access DB and for some reason I cannot get rid of error message, System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. ...
2
by: psychomad | last post by:
Please, can someone help me out to solve this error, i've been searching throughout my codes and yet i didnt succeed in finding the error!!!! The Error is: Server Error in '/' Application....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.