Posts: 4
|
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%"> </TD>
<TD BGCOLOR = "#000077" WIDTH = "5%"> </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%" > </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>
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''
|