Coder1010
Coder1010

Reputation: 29

Making a dynamic array in vbscript whose values are preserved

What I want is an array which would store all the ID values coming from the database.How to do the same?

Upvotes: 0

Views: 443

Answers (1)

AardVark71
AardVark71

Reputation: 4116

This is a task for the ADO GetRows method

<%
Dim aRs, oConn, oRS, sSQL
Set oConn=Server.CreateObject("ADODB.Connection")
oConn.Provider = Application("Provider")
oConn.Open Application("Database"), Application("UserName"), Application("Password")
sSQL="SELECT ID FROM yourtable ORDER by ID"
Set oRS = oConn.Execute(sSQL)
if not oRS.eof then
        aRS=oRS.GetRows()
end if
oRS.close
oConn.close
%>

Upvotes: 2

Related Questions