(var).EOF

R

Robin

I have a select statement that is stored in a variable. How can I tell it
to do something until it reaches EOF.

This is the code I have:
set rs1 = conn.execute("Select * From table where tableID =" &session("ID"))
set rsUnique = conn.execute("Select DISTINCT userID from table2 Where
tableID =" &session("ID"))
if not rsUnique.EOF THen
vSQL = "SQL" & rsUnique("OwnerID")
' ** (so now vSQL = SQL15 for example) **
vFields = "arr" & rsUnique("OwnerID")
vCount = "arr" & rsUnique("OwnerID") & "_Count"
vSQL = ("Select * From Sites where ownerID = " &rsUnique("OwnerID"))
' ** (i.e. SQL15 = ...) **
conn.execute(vSQL)
' ** below is where I'm not sure how to reference a variable record set **
If not vSQL.EOF Then
...blah blah blah
End If


Thanks for any help anyone can give!!
 
R

Robin

Hmm ... I'm a bit of a hack when it comes to any of this!! I've never done
a join before, I'm sure I could figure it out but just not sure if it'll
work for what I need to do ...
I need to get all of the unique userID's from table 1 and create sql
statements, grab some fields for an array, count the number of records. For
each customer the above could be one sql statement or it could many. This
is why I'm setting the sql statement to a variable field ("SQL" & id#).

Will a join help me along with this? If so, I'll research it more.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top