Error Message
I was trying to add some information to a databse for a school project and I was trying to connect to a database and i get the following syntax error: Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
/comfort/reserve.asp, line 60
Can anyone tell me what is wrong with this code:
<% @language=vbscript %>
<% Option Explicit %>
<% Response.Buffer = false %>
<script language=vbscript runat=server>
Dim connObj,strSQL,cmdObj
Dim AddName, AddAddress,AddCompany,AddCity,AddState,AddZip, AddPhone,AddVehicle,AddEmail
Dim AddDate, AddTime,AddHours,AddPassenger,AddDropoffLocation,A ddPickupLocation
Set connObj = Server.CreateObject("ADODB.Connection")
connObj.Open ("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath ("Comfort.mdb"))
Set cmdObj = Server.CreateObject("ADODB.Command")
cmdObj.ActiveConnection = connObj
AddName = Request.Form("cname")
AddAddress = Request.Form("cadd")
AddCompany = Request.Form("c.company")
AddCity = Request.Form("city")
AddState = Request.Form("state")
AddZip = Request.Form("czip")
AddPhone = Request.Form("phone")
AddVehicle = Request.Form("vehicle")
AddEmail = Request.Form("mail")
AddDate = Request.Form("date")
AddTime = Request.Form("time")
AddHours = Request.Form("hour")
AddPassenger = Request.Form("pass")
AddDropoffLocation = Request.Form("dloc")
AddPickupLocation = Request.Form("ploc")
strSQL = "Insert into Reservations (Name,Address,Company,City,State,Zip,Phone,Vehicle ,Email,Date,Time,Hours,Passenger,DropoffLocation,P ickupLocation)"
strSQL = strSQL & " values ("
strSQL = strSQL & "'" & AddName & "',"
strSQL = strSQL & "'" & AddAddress & "',"
strSQL = strSQL & "'" & AddCompany & "',"
strSQL = strSQL & "'" & AddCity & "',"
strSQL = strSQL & "'" & AddState & "',"
strSQL = strSQL & "" & AddZip & ","
strSQL = strSQL & "'" & AddPhone & "',"
strSQL = strSQL & "'" & AddVehicle & "',"
strSQL = strSQL & "'" & AddEmail & "',"
strSQL = strSQL & "'" & AddDate & "',"
strSQL = strSQL & "'" & AddTime & "',"
strSQL = strSQL & "" & AddHours & ","
strSQL = strSQL & "" & AddPassenger & ","
strSQL = strSQL & "'" & AddDropoffLocation & "',"
strSQL = strSQL & "'" & AddPickupLocation & "')"
cmdObj.CommandText = strSQL
cmdObj.Execute(strSQL)
connObj.Close
</script>
<HTML>
<HEAD>
<Title>Atlanta's Comformt Limousine-Confirmations</Title>
</HEAD>
<Body bgcolor="silver" text="dark blue" link="light blue" vlink="light blue">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="935" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="505"><a href="limo-home.htm">
<img src="tcg.gif"
alt="The Premier 24 hour Full-Service Transportation Company in the Entire Metro Atlanta Area"
border="0" width="505" height="127"></a></td>
<td width="4"> </td>
<td valign="middle" background="images/header_bg.gif" width="426">
<div align="left">The Premier 24
hour Full-Service Transportation Company in the Entire Metro
Atlanta Area TM</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" bgcolor="#FFFFFF" align="center">
<p align="left">
<a href="limo-home.htm">Home</a>
|<a href="limo-reserve.asp"> Reservation</a>
| <a href="limo-service.htm">Service
Package</a> | <a href="limo-FAQ.htm">FAQ</a> |
<a href="limo-contact.asp">Feedback/Contact Us</a>
| <a href="limo-fleet.htm">Fleet</a>
| <a href="limo-about.htm">About Us</a></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
<p class="MsoNormal"> &n bsp; &nbs p; &n bsp; &nbs p; &n bsp;
<span style="font-size:36.0pt;font-family:Algerian;
color:#000080;text-shadow:auto">Reservations</span></p>
<p align="center">Thank You ,<% =Request.Form("cname") %> ,Your Information(
below) was entered into our system! You will receive an e-mail with the
next 2 hours.</p>
<p align="center"> </p>
<p align="left"><b>Customer Information</b></p>
<p align="left">required * </p>
<p align="left">*Name: <% =Request.Form("cname") %>
</p>
<p align="left">Company: <% =Request.Form("c.company") %>
</p>
<p align="left">*Address: <% =Request.Form("cadd") %>
</p>
<p align="left">*City: <% =Request.Form("city") %>
</p>
<p align="left">*State: <% =Request.Form("state") %>
</p>
<p align="left">Phone Number: <% =Request.Form("phone") %>
</p>
<p align="left">*E-mail
Address: <% =Request.Form("mail") %>
</p>
<p align="left"> </p>
<p align="left"><b>Reservation Information</b></p>
<p style="MARGIN-TOP: 5px">*Date
of Reservation: <% =Request.Form("date") %>
</p>
<p style="MARGIN-TOP: 5px">*Pickup
Time: <% =Request.Form("time") %>
</p>
<p style="MARGIN-TOP: 5px">Number
of Passengers: <% =Request.Form("pass") %>
</p>
<p style="MARGIN-TOP: 5px">*Pick
Up Location: <% =Request.Form("ploc") %>
</p>
<p style="MARGIN-TOP: 5px">*Drop
Off Location: <% =Request.Form("dloc") %>
</p>
<p align="left">*Number
of hours: <% =Request.Form("hour") %>
</p>
<p align="left">Vehicle Type <% =Request.Form("vehicle") %>
</p>
<p align="left"><b>Service Needed:
</b></p>
<p align="left"> </p>
<p align="left"> </p>
<p align="center"><img border="0" src="tcg.gif" width="128" height="49"></p>
</BODY>
</HTML>
|