Use this to set up the database connection:
<%
'connection.inc create connection to inventory.mdb
dim cnnDataACCESS 'ActiveX Data Object-Connection Object
dim strConnectACCESS 'Connection String
'create instance of ActiveX Connection Object
set cnnDataACCESS = SERVER.createObject("adodb.Connection"

'build the connection string
strConnectACCESS= "Provider=Microsoft.Jet.OLEDB.4.0;"& _
"Data Source="&SERVER.mapPath(".\Resources\PhoneValid.mdb"

&";" & _
"Persist Security Info=False"
cnnDataACCESS.open(strConnectACCESS)
%>
set these up as variables:
Dim rsX, testarray
Const adOpenForwardOnly = 0
Const adLockReadOnly = 1
Const adCmdTable = 1
Set up the RecordSet object:
Set rsX = Server.CreateObject("ADODB.Recordset"
Set up your database query:
I use the variable sQuery
Open the recordset:
rsX.Open sQuery, strConnectAccess, adOpenForwardOnly, adLockReadOnly, adCmdTable
Call the Get rows line:
testarray = rsX.GetRows
Close the connection:
rsX.Close
Set the Connection to Nothing:
set rsX = nothing
You can get the upper bound of the test array by:
UBOUND(testarray, 2)
You can loop through the array using a for loop
You can access the rows and columns of the array by:
testarray(row, column)