Current location: Hot Scripts Forums » Programming Languages » ASP » help please (missing operator) in query expression 'catagoryID ='.


help please (missing operator) in query expression 'catagoryID ='.

Reply
  #1 (permalink)  
Old 02-20-06, 06:39 PM
pez pez is offline
New Member
 
Join Date: Feb 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
help please (missing operator) in query expression 'catagoryID ='.

hi all
i am trying to read the data from the database(table cat) and display the information but for some reason it gives me an error.

this is what it say.

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'catagoryID ='.
/ch26/ShoppingCart/item.asp, line 32

thanks




,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,
<% @LANGUAGE = VBScript %>
<% Option Explicit %>
<HTML>
<HEAD>
<TITLE>Textbook Information Center: Titles</TITLE>
</HEAD>
<BODY BGCOLOR = "#000066">

<CENTER>
<H2><FONT COLOR = "#ffffff">Welcome to the NEWMANS Stationary</FONT></H2></CENTER>
<TABLE BGCOLOR = "#000077" BORDER = "0" WIDTH = "100%"
CELLPADDING = "0" CELLSPACING = "0">
<TR>
<TD BGCOLOR = "#000077" WIDTH = "15%">&nbsp;</TD>
<TD BGCOLOR = "#000077" WIDTH = "5%">&nbsp;</TD>
<TD BGCOLOR = "#000077" WIDTH = "60%">
<FONT COLOR = "yellow" SIZE = "2">Select a title from the
list below:</FONT>
<%
Dim connection, query, data
Set connection = Server.CreateObject( "ADODB.Connection" )
Call connection.Open( "catalog" )
' Create the SQL query and the record set
query = "SELECT * FROM cat WHERE catagoryID = " _
& Request( "catagoryid" )
Set data = Server.CreateObject( "ADODB.Recordset" )
Call data.Open( query, connection )
%>
<UL>
<% ' Begin a while loop that iterates through the records
' in the record set
While Not data.EOF
' Create a link that passes the productID number to
' description.asp and uses the title and the edition
' to label the link.
%> <LI>
<A HREF="description.asp?catagoryid=<% =data( "catagoryID" ) %>">
<FONT COLOR = "#ffffff" SIZE = "3">
<% =data( "name" ) %></A></FONT>
</LI>
<% Call data.MoveNext() ' Move to the next record
Wend
Call data.Close()
Call connection.Close()
%>
</UL>
</TD>
<TD BGCOLOR = "#000077" WIDTH = "5%" >&nbsp;</TD>
<TD WIDTH = "15%"></TD>
</TR>
</TABLE>
<% ' Provide a link back to the previous page %>
<P ALIGN = "center"><FONT SIZE = "3">Back to<STRONG>
<A HREF = "catalog.asp">Catalogue</FONT></A></STRONG>
</P>
<% Dim url

' Store the URL of this page
url = "item.asp?productid=" & Request( "productid" ) %>
<TABLE ALIGN = "center">
<TR>
<TD><IMG SRC = "images/cartonly.gif" ALT = "cartonly.gif">
</TD>
<% ' A form similar to the form in catalog.asp %>
<FORM ACTION = "viewcart.asp" METHOD = "POST">
<TD><INPUT TYPE = "submit" VALUE = "View Cart"></TD>
<INPUT TYPE = "hidden" NAME = "url" VALUE = "<% =url %>">
</FORM>
<TD><IMG SRC = "images/cartonly.gif" ALT = "cartonly.gif">
</TD>
</TR>
</TABLE>

</BODY>
</HTML>

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''
Reply With Quote
  #2 (permalink)  
Old 02-21-06, 01:20 PM
koncept
Guest
 
Posts: n/a
this
query = "SELECT * FROM cat WHERE catagoryID = " _
& Request( "catagoryid" )

should be
query = "SELECT * FROM cat WHERE catagoryID = " & _
Request( "catagoryid" )

Last edited by koncept; 02-21-06 at 01:20 PM. Reason: left out reason
Reply With Quote
  #3 (permalink)  
Old 02-22-06, 07:53 AM
pez pez is offline
New Member
 
Join Date: Feb 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
query = "SELECT * FROM cat WHERE catagoryID = " _
&Request( "catagoryid" )



when i get rid of the highlighted words, i do get the content of table cat but as soon as i add the highlighted code, i get the error.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
code problem throws error matt001 ASP.NET 0 10-23-05 03:30 AM
Nested Query in PHP/MYSQL truesilentassassin PHP 2 07-27-04 07:50 PM
Declared Functions skipper23 PHP 4 12-17-03 10:06 AM
index page not showing up skipper23 PHP 3 12-15-03 01:10 PM
Syntax error (missing operator) in query expression crobinson ASP 4 11-23-03 08:49 PM


All times are GMT -5. The time now is 03:41 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.