August 17, 2005 at 7:59 am
Hi all,
I'm just creating an ADO connection using sql server. But getting an error which i have marked, the message reads as "Expected statement"...googled to find navigation through recordset but could get only for access database, hence decided to get u'r help.
Regards
Arun
<html>
<title>
Creating ADO dataset
</title>
<body>
<%
dim conn,rs,execstring
set conn = server.createobject("ADODB.connection")
set rs = server.createobject("ADODB.recordset")
conn.open "provider = sqloledb,datasource = <myservername>,initial catalog = pubs,user id = user,password = password"
execstring = "select * from pubs"
set rs = conn.execute(execstring)
do while not rs.eof
<%Response.Write rs%> //error statement
<%loop%>
rs.close()
conn.close()
%>
</body>
</html>
August 18, 2005 at 1:51 am
Hi,
You are trying to output the recordset object, what you need to do is output it's contents. Have a look at the rs.getstring method or you can loop the recordset
do while not rs.eof
'output some data e'g. response.write(rs(0))...
rs.movenext
loop
August 18, 2005 at 3:27 am
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply