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

ASP Script Not Working!!

Status
Not open for further replies.

defosset

Programmer
Apr 1, 2003
48
US
Is this error caused due to a setting in IIS or is it because I need MS Access open to acces the data base or is it because I do not have the ODBC datasource linked properly

thanks
Nick

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '(Song Title LIKE '%john%' AND Song Title LIKE '%tesh%') OR (Artist LIKE '%john%' AND Artist LIKE '%tesh%') OR (Intro Time LIKE '%john%' AND Intro Time LIKE '%tesh%') OR (Song Time LIKE '%john%' AND Song Time LIKE '%tesh%') OR (Track Number LIKE '%john%' AND '.
/searchdb.asp, line 127


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; YComp 5.0.2.6; .NET CLR 1.0.3705)

Page:
GET /searchdb.asp?q=john+tesh&mode=AND
 
it will be the spaces in the column names, a space is a delimiter in SQL. Enclosing the column names in square brackets [Column Name] should fix it.

Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
It's because your SQL is malformed. At the beginning there's no SELECT statement (something like "SELECT * FROM MyTable WHERE"), inside there are multi-word table names that aren't surrounded by suare brackets (e.g. "Song Title" should be "[Song Title]"), and it trails off at the end with out finishing (it should probably end with something like "[Track Number] LIKE '%tesh%')").
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top