|
rdouglass -> RE: Getrows musings (1/14/2005 13:10:25)
|
I have a page I use to confirm all the data I am returning to my array. Pop this code on an ASP page by itself; change the connection and query, and browse to it. It basically dumps the array grabbed by getrows into a table. It may shed some light on what is actually being returned. <html>
<head>
<title>GetRows Test</title>
</head>
<body>
<%
Dim arrDBData, conntemp, I, J, rstemp
Dim iRecFirst, iRecLast, iFieldFirst, iFieldLast
Set conntemp = Server.CreateObject("ADODB.Connection")
' Change this line for your database depending on connection:
conntemp.Open "DSN=xxxx;uid=xxx;pwd=xxx;database=xxxx"
' Change this line for your table or query:
Set rstemp = conntemp.Execute("SELECT * FROM tblUsers")
arrDBData = rstemp.GetRows()
rstemp.Close
Set rstemp = Nothing
conntemp.Close
Set conntemp = Nothing
iRecFirst = LBound(arrDBData, 2)
iRecLast = UBound(arrDBData, 2)
iFieldFirst = LBound(arrDBData, 1)
iFieldLast = UBound(arrDBData, 1)
%>
<table border="1">
<%For I = iRecFirst To iRecLast
Response.Write "<tr>" & vbCrLf
For J = iFieldFirst To iFieldLast
Response.Write vbTab & "<td>" & arrDBData(J, I) & "</td>" & vbCrLf
Next
Response.Write "</tr>" & vbCrLf
Next%>
</table>
</body>
</html>
|
|
|
|