|
yogaboy -> GetRows doesn't geddit! (2/9/2005 6:55:42)
|
I've upsized an Access 2003 database into the SQL Desktop Engine on my local box. Finally got the DSN set up (couldn't get the OLEDB to work) and started pulling out data - but it would only get the first few cols of data, then nothing till the last few. I've done a little bit of tinkering, and it seems that if I use myRS("FieldName"), instead of putting the recordset into an array using GetRows, then I get all the data. Does anyone know why this would happen? Here is some code...
'###############
'the connection
Dim myConn
Set myConn = Server.CreateObject("ADODB.Connection")
myConn.CommandTimeout = 0
myConn.Open "accountsSQL"
'################
'the sql statement
SELECT * FROM ByteIt_Journal WHERE ([DateActioned] BETWEEN '01-Sep-2004' AND '31-Dec-2004') ORDER BY DateActioned DESC
'#################
'getrows
alldata=myRS.getrows
numcols=ubound(alldata,1)
numrows=ubound(alldata,2)
myRS.Close
Set myRS = Nothing
myConn.Close
Set myConn = Nothing
'#####################
'outputting the data
For i = 0 to numrows
Response.write "<tr>"
For j = 0 to numcols
response.write "<td class='tds'>"
If alldata(j,i) <> "" then
thisfield = alldata(j,i)#
Response.write thisfield
Else
Response.write " "
End If
Response.write "</td>"
Next
Response.write "</tr>"
Next Here is the quick alternative to GetRows to test the recordset - this works for any field
While NOT myRS.EOF
Response.write "<tr>"
For i = 0 to myRS.Fields.Count - 1
Response.write "<td>: " & myRS(i).value & "</td>"
Next
myRS.MoveNext
Response.write "</tr>"
Wend
In the words of Penelope Pitstop - Hayulp!
|
|
|
|