Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 28th, 2005, 10:00 PM
Authorized User
 
Join Date: Aug 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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">&nbsp;</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>
                    | &nbsp;<a href="limo-service.htm">Service
                    Package</a> |&nbsp;<a href="limo-FAQ.htm">FAQ</a> |
                    <a href="limo-contact.asp">Feedback/Contact Us</a>
                    |&nbsp; <a href="limo-fleet.htm">Fleet</a>&nbsp;
                    | <a href="limo-about.htm">About Us</a></td>
              </tr>
            </table></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;<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)&nbsp; was entered into our system! You will receive an e-mail with the
next 2 hours.</p>
<p align="center">&nbsp;</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">&nbsp;</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">&nbsp;</p>
<p align="left">&nbsp;</p>

<p align="center"><img border="0" src="tcg.gif" width="128" height="49"></p>
</BODY>
</HTML>

 
Old August 29th, 2005, 02:28 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please check the datatype before inserting the data. "text" data needs to be cnclosed in quotes etc..

Om Prakash





Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the error message for a 500 server error? chobo2 C# 2005 1 May 4th, 2008 03:11 AM
Where does the error message go? Wei Wang BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 March 13th, 2006 02:03 PM
Error Message alannoble26 Excel VBA 4 November 25th, 2005 11:20 AM
error message. Tasha Access VBA 2 August 11th, 2004 11:07 PM
Help with Error message mariakovacs Classic ASP Databases 3 October 10th, 2003 03:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.