473,507 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Syntax error in UPDATE statement

Suresh Mahesh
9 New Member
i can't update ms access database

my code is below


Expand|Select|Wrap|Line Numbers
  1. con.ConnectionString = ("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=J:\1111\11111\VMS.accdb")
  2.  
  3.  con.Open()
  4.  
  5.  
  6.  Dim sql As String = "update login set password='11111', where username='suresh'"
  7.  
  8.         Dim objCmd As OleDbCommand
  9.         objCmd = New OleDbCommand(sql, con)
  10.         'objCmd.Connection.Open()
  11.         objCmd.ExecuteNonQuery()//hear error occurred
  12.         con.Close()
<edit: e-mail address removed>



please answer me
Jun 23 '11 #1
2 1853
Jason Kibble
4 New Member
Try removing the comma after the pasword value. You are only trying to set a single value, so there is no need for a comma.
Jun 23 '11 #2
Suresh Mahesh
9 New Member
thank you .. its working
Aug 22 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
6211
by: Robert Mark Bram | last post by:
Hi All! I have the following two methods in an asp/jscript page - my problem is that without the update statement there is no error, but with the update statement I get the following error: ...
6
19155
by: HeadScratcher | last post by:
I am trying to speed up my update statements by removing inner select statements. Example: update orders set shipname = (select contactName from customers where customerid = orders.customerID)...
3
4745
by: William | last post by:
i am using a dataset and a DataAdapter to update a table with the following schema: ResourceID ProjectID LastName FirstName Year Nov Dec Jan
7
6647
by: kosta | last post by:
hello! one of my forms communicates with a database, and is supposed to add a row to a table using an Insert statement... however, I get a 'oledb - syntax error' exception... I have double...
0
1757
by: compuglobalhypermeganetz0r | last post by:
I am having trouble getting an adapter to update my access database, it gives the error Syntax error in INSERT INTO statement. for Line 98: Adapter.Update(WineDS, "tblWines") Below is my...
1
3077
by: amitbadgi | last post by:
HI i am getting the foll error while conv an asp application to asp.net Exception Details: System.Runtime.InteropServices.COMException: Syntax error in UPDATE statement. Source Error: Line...
6
2676
by: FayeC | last post by:
I really need help figuring this out. i have a db with mostly text fields but 2. The user_id field is an autonumber (key) and the user_newsletter is a number (1 and 0) field meaning 1 yes the ...
19
8341
by: Steve | last post by:
ASP error number 13 - Type mismatch with SELECT...FOR UPDATE statement I got ASP error number 13 when I use the SELECT...FOR UPDATE statement as below. However, if I use SELECT statement without...
8
8185
by: Stephen Plotnick | last post by:
I have three forms and update one table in an Access DB with sucess in one form. In the other two forms I'm trying to do an update to a different table in the Access DB. The error I'm getting...
4
2687
by: Jeff Miller | last post by:
This error plagues my SQL and as the error is so generic and comprises multiple lines, I have nothing to search on. I can correct it only to have an "Syntax error in UPDATE statement." So,...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7114
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
7321
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
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5045
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...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.