Print Page | Close Window

What’s wrong with sql

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=3908
Printed Date: 30 March 2026 at 10:06am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: What’s wrong with sql
Posted By: choshour
Subject: What’s wrong with sql
Date Posted: 28 June 2003 at 10:14am

  rs.Open "SELECT * FROM ratings WHERE Ip='" & visitorIP & "' AND TeamName=" & TeamName

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Ip='66.77.7777' AND TeamName=St George'.

The IP is correct I just changed it here
The error points to the sql statement

What is the missing operator in the statement?

If I choose any other choice out of the drop down menu to add to the database I get this.

Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

The field and table names are correct.

This points to the sql statement also




Replies:
Posted By: ljamal
Date Posted: 28 June 2003 at 11:05am
The variable teamname should be surrounded by ''
TeamName='" & TeamName &"'"

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: pmormr
Date Posted: 28 June 2003 at 4:09pm

you forgot the other apostrophe

rs.Open "SELECT * FROM ratings WHERE Ip='" & visitorIP & "' AND TeamName="' & TeamName



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: choshour
Date Posted: 29 June 2003 at 12:56pm
Thanks that worked.  A am having other problems but I get to those later.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net