HTML Help Forum Index HTML Help
Please Search for the answer to your question before asking it! Thanks.
 

Collecting a whole database field into a single variable?
Post a Reply to this Topic Ask a New Question
Click here to go to the original topic
       HTML Help Forum Index -> ASP
View previous topic :: View next topic  
Author Message
jim b



Joined: 12 May 2006
Posts: 14

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
degsy



Joined: 23 Feb 2005
Posts: 2440
Location: North East, UK

Posted: Mon Jul 17, 2006 10:36 am      

Code:
str =  str & """" & rst("username") & """, "
jim b



Joined: 12 May 2006
Posts: 14

Posted: Tue Jul 18, 2006 12:56 am      

Thankyou :D
 
 
HOSTING / DESIGN
MAKE MONEY

       HTML Help Forum Index -> ASP
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group