Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INSERT INTO statement
Message
 
To
19/09/2000 05:04:17
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00417975
Message ID:
00417990
Views:
26
>I got the following error: (VB6 on Access 2000)
>
>Run-time error
>Missing semicolon (;) at end of SQL statement
>
>My SQL statement is:
>cnn1.Execute "INSERT INTO Table1(IndexNo, CustName, Birthday, " & _
>"VALUES('" & Trim(!IndexNo) & "', '" & Trim(!CustName) & "', #" & _
>Trim(CStr(!Birthday)) & "#" & _
>"WHERE Table1.IndexNo <> '" & Trim(!IndexNo) & _
>"' AND Table1.CaseClosed = False"
>
>The error occurs when I added the "WHERE....." statement. Pls advise.

You forget 2 parenthesis (before the Values and the Where keywords). The complete statement should read like:
cnn1.Execute "INSERT INTO Table1(IndexNo, CustName, Birthday) " & _
"VALUES('" & Trim(!IndexNo) & "', '" & Trim(!CustName) & "', #" & _
Trim(CStr(!Birthday)) & "#) " & _
"WHERE Table1.IndexNo <> '" & Trim(!IndexNo) & _
"' AND Table1.CaseClosed = False"
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform