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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL recordset to ASP array

Status
Not open for further replies.

learner45

Technical User
Jul 31, 2009
16
GB
Hi,

I have a recordset containing 2 fields; i.e. Item_ID and Item_Name. The recordset is named rsOrders. What I would like to do is to save the recordset rows into an array of huperlinks - something like this:

varOrder() = "<th><a href="?itemid=<%= rsOrders.Fields.Item(&amp;quot;Item_ID&amp;quot;).Value %>"><%= rsOrders.Fields.Item(&amp;quot;Item_Name&amp;quot;).Value %></a></th>"

The variables in this array will be available for further use in the same ASP page.

I'm a novice... Thanks for your patience and help!!!
 
Code:
dim i
i = 0
do while not rsOrder.eof
 varOrder(i) = "<th><a href='?itemid=" & _
    rsOrders(0) & "'>" & _
    rsOrders(1) & "</a></th>" 
 i = i + 1
 rsOrders.movenext
loop

(not tested)
 
Why not just use the getRows() method??

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top