Groups | Blog | Home
all groups > inetserver asp db > february 2006 >

inetserver asp db : help with sql query from asp page


zerbie45 NO[at]SPAM gmail.com
2/24/2006 3:30:10 PM
I'm running this query against a sql 2005 express ed database which
contains several rows; however it only extracts the first one. How
should it be modified so that it returns all data ? It looks ok to
me.....

Set RS= server.CreateObject("ADODB.Recordset")
RS.Open "Select * from logs", dbConn

for each x in rs.fields
response.write (x)
next

thanks in advance.
zerbie45 NO[at]SPAM gmail.com
2/24/2006 3:58:01 PM
Stupid me ! Forgot about looping..... now it works perfectly !

Thanks bob
Bob Lehmann
2/24/2006 4:47:52 PM
That's because you're not moving through the recordset, only the current
row.

You've got alot of other problems, which I will leave to others to point out
to you, but for your immediate need....

do while not rs.eof
for each x in rs.fields
response.write (x) & "  "
next
response.write "<br>"
rs.movenext
loop

Bob Lehmann

[quoted text, click to view]

AddThis Social Bookmark Button