473,662 Members | 2,413 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 1859
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
6222
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: Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Syntax error in UPDATE statement. /polyprint/dataEntry.asp, line 158
6
19164
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) I read some articles which said that I should be able to use an inner join on the update statement like the following:
3
4765
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
6659
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 checked, and the insert works fine (tried to use it from access)... im using visual C# express 2k5... what could be wrong? thanks!
0
1762
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 code: <%@ Control Explicit="True" Language="VB" Debug="True" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.OleDb" %>
1
3088
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 112: MM_editCmd.ActiveConnection = MM_editConnection Line 113: MM_editCmd.CommandText = MM_editQuery Line 114: MM_editCmd.Execute
6
2684
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 person wants to receive a newsletter and 0 no, don't want to receive it. Now.....when trying to create an UPDATE statement I am running into problems writing the code for it. I had issues before with missing commas but now that the commas are there...
19
8363
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 FOR UPDATE, it is fine and no error. I also tried Set objRs = objConn.Execute("SELECT * FROM EMP UPDATE OF EMPNO"), but it still couldn't help. any ideas? I tried to search in the web but couldn't find similar
8
8194
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 in syntax error on Update on the statement da.update(mydataset, "DATABASENAME") I do have a primary key on both and copied the code from the working update
4
2690
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, sample Error begins at TRUE and ends before the WHERE. UPDATE SET . = TRUE -- Toggle Yes/No on INNER JOIN
0
8856
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8545
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6185
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.