navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

error on insert

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> error on insert
Page: [1]
 
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.

(in reply to chadb)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> error on insert
Page: [1]
Jump to: 1





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