|
| |
|
|
chadb
Posts: 485 From: Kansas Status: offline
|
error on insert - 2/28/2008 9:20:00
I am sure I am overlooking the obvious, but I am getting this error: Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. /updated.asp, line 11 using: Dim myDSN myDSN = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("fpdb\maplandates.mdb") set MyConn=server.createobject("adodb.connection") MyConn.open myDSN sql = "INSERT INTO Calendar (date,event)" sql = sql & "VALUES ('" & (Request.Form("date")) & "'," & "'" & (Request.Form("event")) & "')" MyConn.execute(sql)
|
|
|
|
rdouglass
Posts: 9167 From: Biddeford, ME USA Status: offline
|
RE: error on insert - 2/28/2008 10:45:09
quote:
sql = "INSERT INTO Calendar (date,event)" sql = sql & "VALUES ('" & (Request.Form("date")) & "'," & "'" & (Request.Form("event")) & "')" If that is a Date/Time field in the DB, try it this way: sql = "INSERT INTO Calendar ([date],event)" sql = sql & "VALUES (#" & (Request.Form("date")) & "#, '" & (Request.Form("event")) & "')" 1. "date" is a reserved word so you need to surround it with square brackets when using it as a field name. 2. Date/time fields in Access use a # for a delimiter instead of the apostrophe. That help any?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|