HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Collecting a whole database field into a single variable?
Post new topic   Reply to topic    HTML Help Forum Index -> ASP
View previous topic :: View next topic  
Author Message
jim b



Joined: 12 May 2006
Posts: 14

PostPosted: Sun Jul 16, 2006 4:02 am     Collecting a whole database field into a single variable? Reply with quote

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

PostPosted: Mon Jul 17, 2006 10:36 am     Reply with quote

Code:

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



Joined: 12 May 2006
Posts: 14

PostPosted: Tue Jul 18, 2006 12:56 am     Reply with quote

Thankyou Very Happy
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> ASP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial