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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax error- missing operator

Status
Not open for further replies.

Bonk

IS-IT--Management
Nov 2, 2001
1
US
Code:
strSQL="SELECT DISTINCT eeg.Area_Of_Interest, eeg_Ecological_Group FROM Entomologist_Ecological_Group eeg, Area_Of_Interest ai WHERE eeg.Area_Of_Interest=ai.Area_Of_Interest AND eeg.Unique_Id="& objECI("Unique_Id") & " AND eeg.Ecological_Group="& objECI("Ecological_Group")
I get the following error for this line of code- can anyone help?:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'eeg.Area_Of_Interest=ai.Area_Of_Interest AND eeg.Unique_Id=126 AND eeg.Ecological_Group=Forest soil arthropods'.
 
It lokks like you haven't delimited the string value.
Try the following:

Code:
strSQL="SELECT DISTINCT eeg.Area_Of_Interest, eeg_Ecological_Group FROM Entomologist_Ecological_Group eeg, Area_Of_Interest ai WHERE eeg.Area_Of_Interest = ai.Area_Of_Interest AND eeg.Unique_Id = "& objECI("Unique_Id") & " AND eeg.Ecological_Group = '"& objECI("Ecological_Group") & "';"

James :)
James Culshaw
jculshaw@active-data-solutions.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top