If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Syntax error (missing operator) in query expression

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-19-03, 22:35
fateman fateman is offline
Registered User
 
Join Date: Jul 2003
Posts: 3
Syntax error (missing operator) in query expression

This is the full error:

Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'Band = ''A Perfect Circle'''.
/results.asp, line 20

And here is the code Dreamweaver creates:

Set results = Server.CreateObject("ADODB.Recordset")
results.ActiveConnection = MM_shnlist_STRING
results.Source = "SELECT * FROM Bands WHERE Band = '" + Replace(results__MMColParam, "'", "''") + "'"
results.CursorType = 0
results.CursorLocation = 2
results.LockType = 1
results.Open()

It says the error is on the last line "results.Open()"

How do I fix this?

Thanks
Reply With Quote
  #2 (permalink)  
Old 07-23-03, 01:24
Memnoch1207 Memnoch1207 is offline
Registered User
 
Join Date: Jan 2003
Location: Midwest
Posts: 138
dreamweaver sucks at creating and maintaining database connections...try running the query in the database itself, then compare the database query with the query dreamweaver created.
Reply With Quote
  #3 (permalink)  
Old 07-30-03, 08:48
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
I copied and pasted what you wrote to an editor:
'Band = ''A Perfect Circle'''

And I noticed that all the quotes are single quotes. I.e. even what looks like a double quote is really two single quotes.
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On