|
 |
asp_databases thread: help in Syntax error
Message #1 by blueatmosphere@y... on Wed, 9 Oct 2002 09:20:52
|
|
please help , i have a problem with database:
set conn = Server.CreateObject("ADODB.Recordset")
conn.Open "SELECT productID, productname, descriptions, price, picture
FROM product",
conn
%>
<table border="1" width="100%">
<%do until conn.EOF%>
<tr>
<%for each x in conn.Fields%>
<td>
<%Response.Write(x.value)%></td>
<%next
conn.movenext %>
</tr>
<%loop
conn.close
%>
and the error is
Microsoft VBScript compilation (0x800A03EA)
Syntax error
on conn.Open "SELECT productID.....
conn.Open "SELECT productID, productname, descriptions, price, picture
FROM product",
---------------------------------------------------------------------------
---------^
thanks
Message #2 by "Ken Schaefer" <ken@a...> on Wed, 9 Oct 2002 18:50:41 +1000
|
|
a) When you open a recordset you have to supply a valid *connection object*
as source. You are supplying "conn", but you just instantiated that as a
recordset.
b) everything needs to be on the same line. You have a comma, then "conn" on
the 2nd line.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: <blueatmosphere@y...>
To: "ASP Databases" <asp_databases@p...>
Sent: Wednesday, October 09, 2002 9:20 AM
Subject: [asp_databases] help in Syntax error
: please help , i have a problem with database:
:
:
: set conn = Server.CreateObject("ADODB.Recordset")
: conn.Open "SELECT productID, productname, descriptions, price, picture
: FROM product",
: conn
:
: %>
: <table border="1" width="100%">
: <%do until conn.EOF%>
: <tr>
: <%for each x in conn.Fields%>
: <td>
: <%Response.Write(x.value)%></td>
: <%next
: conn.movenext %>
: </tr>
: <%loop
: conn.close
: %>
:
: and the error is
:
:
: Microsoft VBScript compilation (0x800A03EA)
: Syntax error
: on conn.Open "SELECT productID.....
: conn.Open "SELECT productID, productname, descriptions, price, picture
: FROM product",
: --------------------------------------------------------------------------
-
: ---------^
:
: thanks
|
|
 |