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

Home Posts Topics Members FAQ

error 3137, Missing semicolon (;) at end of SQL statement

I am using Winxp and Ms Access 2003.

I get this error message:

error 3137, Missing semicolon (;) at end of SQL statement

when I run this code:

Dim I As Integer
For I = 0 To Me.lstparcelblock.ListCount - 1
csql = "insert into parcelblockvaluation (parcelblockid,
valuationid) values (" _
& Me.lstparcelblock.Column(1, I) & ", " & Me.ValuationId & ")" _
& " where valuationid = " & Me.ValuationId & ";"
Debug.Print csql
DoCmd.RunSQL csql ' here the program stops with the error message
above

This is what is printed to the immediate window:

insert into parcelblockvaluation (parcelblockid, valuationid) values
(2, 3) where valuationid = 3;
insert into parcelblockvaluation (parcelblockid, valuationid) values
(2, 5) where valuationid = 5;

I do have a table called parcelblockvaluation and two of its fields are
parcelblockid and valuationid, they are both numerical.

Any help is greatly appreciated.

Regards,

Jan Nordgreen

Nov 13 '05 #1
2 9254
You are trying to use a where clause with a Values insert? I'm pretty sure
that's the problem.

On 2 Mar 2005 11:53:05 -0800, ja**********@gmail.com wrote:
I am using Winxp and Ms Access 2003.

I get this error message:

error 3137, Missing semicolon (;) at end of SQL statement

when I run this code:

Dim I As Integer
For I = 0 To Me.lstparcelblock.ListCount - 1
csql = "insert into parcelblockvaluation (parcelblockid,
valuationid) values (" _
& Me.lstparcelblock.Column(1, I) & ", " & Me.ValuationId & ")" _
& " where valuationid = " & Me.ValuationId & ";"
Debug.Print csql
DoCmd.RunSQL csql ' here the program stops with the error message
above

This is what is printed to the immediate window:

insert into parcelblockvaluation (parcelblockid, valuationid) values
(2, 3) where valuationid = 3;
insert into parcelblockvaluation (parcelblockid, valuationid) values
(2, 5) where valuationid = 5;

I do have a table called parcelblockvaluation and two of its fields are
parcelblockid and valuationid, they are both numerical.

Any help is greatly appreciated.

Regards,

Jan Nordgreen


Nov 13 '05 #2
Stupid me! What was I thinking?!

Thanks for pointing it out.

My only excuse must be that before this query I had written lots of
update queries where the where clause makes sense. :)

Nov 13 '05 #3

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

Similar topics

7
2182
by: BWGames | last post by:
Can someone tell me whats up with this code please? $update_query = "UPDATE users SET creditremaining = creditremaining - " . $_REQUEST . "WHERE mobilenumber = " . $_REQUEST . ""; where...
4
4221
by: erika | last post by:
I am trying to run the following update query in code. UPDATE TableTest SET STATUS = "A" WHERE (Code <> "X") AND (Code <> "J") ORDER BY DOB; I am getting an error, "Missing Semicolon (;) at...
18
484
by: Bill | last post by:
I'm getting a syntax error on line 18 of this code and I don't see a missing ";". Does anyone else see it? #include < stdio.h> void main() { FILE *fp; int i; int CharString;
4
1494
by: jackchang1 | last post by:
It took me a while to figure out this error functiom method1(){ alert(); } by this error message missing ; before statement functiom method1(){ alert(); } why Javascript can't tell me...
4
5647
by: liz0001 | last post by:
Hi, I am getting this error when I try to run my code: Missing semicolon (;) at end of SQL statement However, there is a semicolon at the end of my statement. Here is the statement: INSERT...
3
1574
by: Greg Corradini | last post by:
Hello, I'm trying to perform a simple insert statement into a table called Parcel_Test (see code below). Yet, I get an error message that I've never seen before (see traceback below). I've tried...
2
5747
by: im2cre8iv | last post by:
Here is my code where I am receiving the error: #include <fstream> #include "BinaryTree.h" using namespace std; Node* BinaryTree::MakeTree(ifstream& infile) { char name; infile>>name;
1
1573
by: radhikabece | last post by:
I m writhing the code as below in the button click event: Dim count As String = "select max(CutomerId) from CustomerInfo" cn.Open() cmd = New OleDbCommand(count, cn) ...
6
2253
by: David Mathog | last post by:
Do any of you happen to have links to compendiums (or heaven forbid, an actual manual) which maps compiler warnings and errors to examples of actual code problems? In this case I'm specifically...
0
7314
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
7372
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
7482
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...
1
5041
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
3191
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
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 ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.