Posted: Sun Jul 16, 2006 4:02 am Collecting a whole database field into a single variable?
I am trying to collect a whole database field into a single variable, I have go this far. If you look at the response.write loop that is the information I am trying to collect into the variable (in that format).
Code:
set cnn = Server.CreateObject("ADODB.Connection")
set rst = Server.CreateObject("ADODB.RecordSet")
cnn.Open "driver={Microsoft Access Driver (*.mdb)};;DBQ=c:/inetpub/wwwroot/intranet/login.mdb;"
sqltext = "SELECT username FROM userinfo"
rst.open sqltext,cnn
while not rst.EOF
response.write """" & rst("username") & """, "
rst.MoveNext
wend
rst.close
cnn.close
set rst = nothing
set cnn = nothing
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum