Syntax error in INSERT INTO statement 
Author Message
 Syntax error in INSERT INTO statement

When I try to execute the code below I get the following error message:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
       [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT
INTO statement.
       /assets/note.asp, line 51

Here is the code:

Dim strCnn
strCnn="DSN=Assets"
set cnn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
cnn.connectionstring=strCnn
cnn.Cursorlocation=3
cnn.open

Dim strWO_ID
Dim intWO_ID
Dim strNote_Date
Dim strNote_User
Dim strNote_Action
Dim strNote

strWO_ID = Request.Form("woid")
intWO_ID = cInt(strWO_ID)
strNote_Date = Request.Form("date")
strNote_User = Request.Form("user")
strNote_Action = Request.Form("action")
strNote = Request.Form("note")

Set rs=cnn.Execute("INSERT INTO Notes (WO_ID, Note_Date, Note_User,
Note_Action, Note) VALUES ('" & intWO_ID & "', '" & strNote_Date & "',
'" & strNote_User & "', '" & strNote_Action & "', '" & strNote & "')")

Thanks for your help,

Peter Campopiano



Mon, 16 Dec 2002 03:00:00 GMT  
 Syntax error in INSERT INTO statement
Peter:

Hello. Sorry my bad english.

Try use the Response.Write method to display the string in your page.

    Response.Write "INSERT INTO Notes (WO_ID, Note_Date, Note_User, _
    Note_Action, Note) VALUES ('" & intWO_ID & "', '" & strNote_Date & "', _
    '" & strNote_User & "', '" & strNote_Action & "', '" & strNote & "')"

So, paste in Access SQL Pass-through query and execute it. Probably you'll
sse what's happening.

Hope this helps.

Marcelo L Guimaraes

Quote:
> When I try to execute the code below I get the following error message:

> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
>        [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT
> INTO statement.
>        /assets/note.asp, line 51

> Here is the code:

> Dim strCnn
> strCnn="DSN=Assets"
> set cnn = Server.CreateObject("ADODB.Connection")
> set rs = Server.CreateObject("ADODB.Recordset")
> cnn.connectionstring=strCnn
> cnn.Cursorlocation=3
> cnn.open

> Dim strWO_ID
> Dim intWO_ID
> Dim strNote_Date
> Dim strNote_User
> Dim strNote_Action
> Dim strNote

> strWO_ID = Request.Form("woid")
> intWO_ID = cInt(strWO_ID)
> strNote_Date = Request.Form("date")
> strNote_User = Request.Form("user")
> strNote_Action = Request.Form("action")
> strNote = Request.Form("note")

> Set rs=cnn.Execute("INSERT INTO Notes (WO_ID, Note_Date, Note_User,
> Note_Action, Note) VALUES ('" & intWO_ID & "', '" & strNote_Date & "',
> '" & strNote_User & "', '" & strNote_Action & "', '" & strNote & "')")

> Thanks for your help,

> Peter Campopiano



Mon, 16 Dec 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. -2147217900 Error: Syntax error in INSERT INTO statement

2. Syntax error in INSERT INTO statement.

3. Syntax error in INSERT statement

4. Need help with syntax of INSERT INTO statement

5. vbscript syntax error - expected end of statement

6. As Statement Syntax Error

7. Syntax error in SQL statement

8. vbscript/sql insert statement error

9. Syntax Error in Update Statement.

10. Syntax error in UPDATE statement

11. ASP Syntax error in UPDATE statement.

12. Syntax Error in SQL statement

 

 
Powered by phpBB® Forum Software