If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
SQL Error Help
The following is the SQL that I have in my code:
strSQL = "INSERT INTO taDEFENDANTS(TrusteeDefendantID)" & _ "VALUES(lngTrusteeDefendantID)" & _ "WHERE DefendantID=" & lngDefendantID & ";" I keep getting the following error: Run-time error 3137: Missing semicolon ( at end of SQL statement. What am I not including so that the code 'sees' the semicolon. Thanks, Ray. |
#2
|
|||
|
|||
SQL Error Help
When you use an INSERT statement, you would not have a WHERE clause (except
in a subquery). If you are trying to change the value of a record that is already in the table (e.g. the record where DefendantID = lngDefendantID), then this should be an UPDATE query. Also, you are missing several spaces in the SQL statement. You should start each line after the first with a space (e.g. " WHERE...) . -- Daryl S "RayToddJr" wrote: The following is the SQL that I have in my code: strSQL = "INSERT INTO taDEFENDANTS(TrusteeDefendantID)" & _ "VALUES(lngTrusteeDefendantID)" & _ "WHERE DefendantID=" & lngDefendantID & ";" I keep getting the following error: Run-time error 3137: Missing semicolon ( at end of SQL statement. What am I not including so that the code 'sees' the semicolon. Thanks, Ray. |
Thread Tools | |
Display Modes | |
|
|