Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Error

Status
Not open for further replies.

larryman

Programmer
Jun 16, 2000
63
0
0
US
Please,

Can anyone help figure out the source of error in the SQL statement below. I keep getting this error.

Microsoft JET Database Engine error '80040e14'

Syntax error in FROM clause.


strSQL = "SELECT AirOrder.Passenger_No," _
& "AirOrder.Date, AirOrder.Department, AirOrder.[E-mail_Address]," _
& "AirOrder.Purpose_Travel, AirOrder.Way, AirOrder.Depart," _
& "AirOrder.Departure_Date, AirOrder.Departure_Time, AirOrder.Destination," _
& "AirOrder.Return_Date, AirOrder.Return_Time, AirOrder.Approval_Email," _
& "airbooking.Name, airbooking.OrderNo FROM AirOrder INNER JOIN airbooking ON" _
& "AirOrder.OrderId = airbooking.OrderNo Where airbooking.OrderNo = "& Request.QueryString("OrderId")&""

Set rs = dcnDB.Execute(strSQL)


Oysterbar ride to success. Keep Riding
 
before executing do a response.write and post the output:
response.write strSQL
Set rs = dcnDB.Execute(strSQL)

Known is handfull, Unknown is worldfull
 
Make sure that there is a space between the Fieldnames and SQL Clauses.

Check it with

Response.Write strSQL

then copy/paste and run it directly in the SQL Query Analyzer or access (what ever DB are you using)

---Error Source---
& "airbooking.Name, airbooking.OrderNo FROM AirOrder INNER JOIN airbooking ON" _
& "AirOrder.OrderId = airbooking.OrderNo Where Request.QueryString("OrderId")&""
--------------
Inster a space after ON or before the AirOrder in the next line.

I hope this will help.














 
Adroit,

Thanks, it's working with the space recommended.

vbkris, Thanks too.

Larryman

Oysterbar ride to success. Keep Riding
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top