Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 18th, 2004, 11:44 AM
twe twe is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 24 twe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Syntax error - help ?

Hey,
I get this error with my code, and I have no idea why, can you PLEASE help me

Thanks

Twe


Microsoft JET Database Engineerror '80040e14'

Syntax error in INSERT INTO statement. /work/flightbooking.asp, line 39


<%
Form_bookingid = Trim(Replace(Request.Form("bookingid"),"""",""""""))
Form_seatnumber = Trim(Replace(Request.Form("seatnumber"),"""",""""""))
Form_typeofperson = Trim(Replace(Request.Form("typeofperson"),"""",""""""))
Form_passengername = Trim(Replace(Request.Form("passengername"),"""",""""""))
Form_flightcode = Trim(Replace(Request.Form("flightcode"),"""",""""""))
%>
<HTML>
<BODY>
Error. Click back in your browser, and fill it out properly! All fields are required.
</HTML>
</BODY>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "C:\Inetpub\wwwroot\work\project.mdb"
sql="INSERT INTO PassengerBooking (BookingID,"
sql=sql & "BookingSeat,PassengerName,BookingPersonType,Flight ID"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("bookingid") & "',"
sql=sql & "'" & Request.Form("seatnumber") & "',"
sql=sql & "'" & Request.Form("typeofperson") & "',"
sql=sql & "'" & Request.Form("passengername") & "',"
sql=sql & "'" & Request.Form("flightcode") & "')"
conn.Execute sql,recaffected
conn.close
%>
<HTML>
<BODY>
<B>Thank you for booking a flight, if you wish to make another booking, please go back and use the same booking ID</B>
</HTML>
</BODY>
<%
END IF
%>

Reply With Quote
  #2  
Old April 18th, 2004, 12:50 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,760 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 5 h 22 m 16 sec
Reputation Power: 443
Text data types are surrounded by (') single quotes, number types aren't.
If BookingID and FlightID are numbers in the database, then try this.
Code:
strSql = "INSERT INTO PassengerBooking(BookingID, BookingSeat, PassengerName, BookingPersonType, FlightID) VALUES(" & Request.Form("bookingid") & ", '" & Request.Form("seatnumber") & "', '" & Request.Form("typeofperson") & "', '" & Request.Form("passengername") & "', " & Request.Form("flightcode") & ")"

Last edited by Memnoch : April 18th, 2004 at 12:53 PM.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Syntax error - help ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway