
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