Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating an array from an SQL statement or a Query

Status
Not open for further replies.

xhonzi

Programmer
Joined
Jul 29, 2003
Messages
196
Location
US
I'm having a terrible time with this:
I want to execute a loop of code on a series of values.
These values are available through some SQL that is generated by another part of the script.

Anyways, I was looking into the For Each .. Next loop and found that it can either use collections or arrays. So, I want to populate my array with these aforementioned values and then do a for each .. next loop on them. I have tried lots of different combinations but I cannot successfully get my array to populate correctly. There has to be an easy way of doing this. Either from the direct SQL or from a query that I can create and store based on the same SQL.

Any help?

Xhonzi
 
Look at the GetRows() method of Recordset object, which can be used to populate an array.

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
Thank you, I have been looking at that method all day. I can't seem to get that, or anything else, to work.

Xhonzi
 
Nevermind. I got it working now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top