473,382 Members | 1,353 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,382 software developers and data experts.

ACCESS Update Command Not Working

Hi

Can someone please tell me why this following UPDATE command doesn't update the DB?
Expand|Select|Wrap|Line Numbers
  1. UPDATE tblTest SET tblTest.Answer1 = '92107933' AND tblTest.Answer2='2006-12-17'
  2. WHERE ID=1;
The Answer1 and Answer2 fields are configured as Text. This update command doesn't work, but this one does.

Expand|Select|Wrap|Line Numbers
  1. UPDATE tblTest SET tblTest.TimeStarted ='16:18:18.2820743' WHERE ID = 1
What am I doing wrong? Is is because I'm trying to set 2 fields in the first query and only 1 in the second query?

Pls Help?

Tanks
Jan 15 '07 #1
1 6207
ADezii
8,834 Expert 8TB
Hi

Can someone please tell me why this following UPDATE command doesn't update the DB?
UPDATE tblTest SET tblTest.Answer1 = '92107933' AND tblTest.Answer2='2006-12-17'
WHERE ID=1;

The Answer1 and Answer2 fields are configured as Text. This update command doesn't work, but this one does.

UPDATE tblTest SET tblTest.TimeStarted ='16:18:18.2820743' WHERE ID = 1

What am I doing wrong? Is is because I'm trying to set 2 fields in the first query and only 1 in the second query?

Pls Help?

Tanks
It's simply a matter of Syntax, drop the AND and place a comma between multiple Fields in the Update Statement. Hope this helps.
Expand|Select|Wrap|Line Numbers
  1. Dim MySQL As String
  2.  
  3. MySQL = "UPDATE tblTest SET tblTest.Answer1 = '92107933', tblTest.Answer2 = '2006-12-17' WHERE ((([tblTest].[ID])=1));"
  4.  
  5. DoCmd.RunSQL MySQL
Jan 15 '07 #2

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

Similar topics

4
by: Charlie Williams | last post by:
I am having difficulty performing updates and deletions on an Access database using the Update() method of the OleDBDataAdapter. I can insert rows without a problem, but I get a concurrency...
14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
3
by: | last post by:
Hi, I have a major problem. I use Windows 2000 highest SP and ACCESS 2000 inside Office 2000 SP-3. I want to use the following simple command inside ACCESS in VBA UPDATE tbl_SATURN_Benutzer...
1
by: Bryan Masephol | last post by:
Hi All I have a OleDbConnection as the "connection" below. I'm retriving a dataset from an access 2002 db and displaying it in a DataGrid. I'm making the connection to my access db file with...
6
by: Fred Geurtsen | last post by:
Question about updating a access Database Record! Normally i'm working with SQLserver, but i have to do this with access and it's not working. My error is: Operation must use an updateable query....
4
by: George | last post by:
Hi all, I am having trouble with updating my data in an Access database. here is my code: Imports System.Data.OleDb Dim AppPath As String = Mid(Application.ExecutablePath, 1,...
2
by: travhale | last post by:
in a new project using .net 2005, c#. getting err message "Update requires a valid UpdateCommand when passed DataRow collection with modified rows." source RDBMS is oracle 8i. I add a new...
13
by: Terry Olsen | last post by:
I'm using OleDb to connect with an Access Database. I have anywhere from 10 to over 100 records that I need to either INSERT if the PK doesn't exist or UPDATE if the PK does exist, all in a single...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.