strSQL = "SELECT * FROM Products" set conn = Server.CreateObject("ADODB.Connection") set rs = Server.CreateObject("ADODB.Recordset") conn.Open "Provider=SQLOLEDB.1;", "admin", "" rs.Open "Products",conn,adOpenKeyset,adLockOptimistic varCount = rs.RecordCount-1 dim Arr() redim Arr(varCount,2) rs.MoveFirst if not rs.EOF and not rs.BOF then do while not rs.EOF Arr(i,0) = rs.Fields("ProductID") Arr(i,1) = rs.Fields("ProductName") Arr(i,2) = rs.Fields("UnitPrice") rs.MoveNext i = i + 1 loop else Response.End end if rs.Close set rs = nothing conn.Close set conn = nothing |