473,657 Members | 2,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Syntax error in query...(ADO.NE T + MS Access)

I am trying to update a field in Access db (.mdb) via a DataSet using
the following code. I am continously getting this error:

Has anybody seen this before?

1. If I try using the same code for any other .mdb file, it works
perfectly.

2. This is a Winform application, so no problems about the ASPNET wp
being granted rights.

Message:
"Syntax error in query expression '( (RowNumber = ?) AND ((? = 1 AND
TimeStampValue IS NULL) OR (TimeStampValue = ?)) AND ((? = 1 AND MS IS
NULL) OR (MS = ?)) AND ((? = 1 AND Frame_Number IS NULL) OR
(Frame_Number = ?)) AND ((? = 1 AND Direction IS NULL) OR (Direction =
?)) AND ((? = 1 AND'."

CODE
{
string query = "select * from tablename";

//conn is the respective connection
OleDbDataAdapte r da= new OleDbDataAdapte r(query, conn);

da.Fill(myDS, "tablename" );

OleDbCommandBui lder myOleDbCommandB uilder = new
OleDbCommandBui lder(da);

myDS.Tables["tablename"].Rows[0]["somerow"] = "somevalue" ;

//following line throws the exception
da.Update(myDS, "tablename" );

Nov 13 '05 #1
1 2036
I've never done an update in this way, but the .NET framework
documentation says that you must set the SelectCommand property of the
OleDbDataAdapte r. This gives the CommandBuilder a hint on how to
formulate an update statement. See the documentation for the
OleDbCommandBui lder Class.

Bill E.
Hollywood, FL

Nov 13 '05 #2

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

Similar topics

29
2477
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules" for when and how to use single quotes and double quotes in ASP? thanks! ---------------------- SQL = SQL & "WHERE '" & REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE("GenKTitles.
0
1510
by: Chris R. | last post by:
I'm trying to do what I thought was a fairly simple thing, select a group of records from a mySQL database. I'm not much of an SQL guy. The syntax I would use for Microsoft SQL is shown on the "query =" line. A myODBC error message indicates this is not supported syntax. Can anyone help me? { ADO Startup Values and Creation using the .Open method} {Create a COM object reference to ADO Recordset.}
4
11519
by: Robert | last post by:
What is the syntax to use in a VBA script to execute a pass-through? Thanx
3
3102
by: KevLow | last post by:
Hi, Hope some kind soul can help me out here.. I'm trying to programmatically modify the column headings of a crosstab query such that it can be dynamic based on user specified period (Month Year to Month Year) So far i have tried to use the following code: //
6
2266
by: iam247 | last post by:
Hi I am a relative beginner with ASP and weak on syntax for sql statements. Basically I modify something which works. I have tblGroupContact with two fields both long integer - ContactID & GroupID I am using asp3.0 and VB Script
1
7858
by: iam247 | last post by:
Hi I am a relative beginner with SQL and ASP. With some help after previous posts I have a page which successfully requests querystrings from another page and deletes a record from an access table, However, I get the error message: "Row handle referred to a deleted row or a row marked for deletion" I am using access 2002, the table only has 2 fields (ContactID and
1
3590
by: iam247 | last post by:
Hi I have a web page which receives information from a form (using request.form) and also attempts to look at an Access query to read in recoeds to a variable named rsGroup. When I have the following line commented, so it does not activate, I can successfully print all of the response.write's below: rsGroup.Open strSQL, adoCon
1
1651
by: amitbadgi | last post by:
I am gettign this error while converting an asp application to asp.net , its a query syntax error, Exception Details: System.Runtime.InteropServices.COMException: Syntax error in query expression 'id =System.__ComObject'. Source Error: Line 191: counter = 1Line 192: for i = 0 to ubound(emaillist)Line 193: rs_email = conn.execute("select * from tblusers where id =" & emaillist(i))Line 194: tolist = tolist & rs_email("email") &...
6
2018
by: Ben | last post by:
I am trying to migrate my vb6.0 over to vb.net. Here is the error that that I am stuck with: Public myDB As DAO.Database ..... path = System.IO.Path.GetFullPath("..") myDB = WS.OpenDatabase(path & "\access.MDB", False, True) 'after I've created my workspace where WS is my workspace, I opend it up and vb.net recognized it. DeckUsers = dbCycDeck.OpenRecordset("USERS")
0
8392
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
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
8503
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
7321
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
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
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
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...
1
2726
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

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.