how to I loop through the items in a server object
I am trying to loop through a record set for items that meet certain criteria. Here's my code..
'CONNECT FROM THE PAGE TO THE DATA SOURCE
Dim theImgSource, Connect, requestrs, Query, id
Set Connect = server.CreateObject("ADODB.Connection")
Connect.ConnectionString = getConnectionStr("test")
Connect.open
'INSTANTIATE A CONTAINER FOR THE DESIRED DATA
Set rs = server.createobject ("adodb.recordset")
Query = "SELECT tblImgs.refForImage FROM tblImgs WHERE ((tblImgs.active)=True)"
rs.open Query, connect
'ASSIGN THE DATA TO THE VARIABLE ON THE PAGE
dim item
For Each item in rs
Select Case imgName
case "rmo1topimg"
rmo1topimg = serverContainer("refForImage")
case "rmo2topimg"
rmo2topimg = serverContainer("refForImage")
End Select
Next
%>
The line that throws an error is " For Each item in rs ". I seem to be incorrectly referring to the collection of records specified by the query. Ideas?
|