View Single Post
  #8 (permalink)  
Old September 20th, 2004, 01:25 PM
inquiringminds inquiringminds is offline
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay I'm starting this out and I'm basing it on code I got from a ASP forum site. This is just to set up the form and test that it writes to a MS-Access Db.. but I keep getting the following

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/ncmh/form_ac.asp, line 29

here is the code on the Insert line and below

data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("questionstest.mdb")
sql_insert = "INSERT INTO questionstest (firstname, lastname, agency, phone, email, urgency, contact, question, date) VALUES " &_
"('" & mgfirstname & "', '" & mglastname & "', '" & mgagency & "', '" & mgphone & "', '" & mgemail & "', '" & mgurgency & "', '" & mgcontact &_
"', '" & mgquestion & "', '" & mgdate & "')"

'Creating Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source
con.Execute sql_insert