Hi all,
I'm optimizing my asp-application with a SQL Server 2000 database. I was wondering whether there's a difference between opening a recordset with rst.CursorLocation = adUseClient
Set rst = Server.CreateObject("ADODB.Recordset"
rst.CursorLocation = adUseClient
rst.Open strSQL,objConn
rst.ActiveConnection = Nothing
objConn.Close
Set objConn = Nothing
Set objCmd = Nothing
Do until rst.eof
.....
Loop
rst.close
set rst = nothing
where I can close the connection before starting to iterate through the recordset but the recordset remains
and using the getrows
Set rst = Server.CreateObject("ADODB.Recordset"
rst.CursorLocation = adUseClient
rst.Open strSQL,objConn
alldata= rst.getrows
rst.close
set rst = Nothing
objConn.Close
Set objConn = Nothing
Set objCmd = Nothing
numrows=ubound(alldata,2)
FOR rowcounter= 0 TO numrows
....
NEXT
where I can immedeately close the recordset and the data are loaded in an array.
I'm hence wondering what the difference is between the two and which one will give me the best performance? (my database is still to small to see an actual difference but will grow soon in size and number of users)
Thanks a lot in advance.
Greetz,
Dirk
I'm optimizing my asp-application with a SQL Server 2000 database. I was wondering whether there's a difference between opening a recordset with rst.CursorLocation = adUseClient
Set rst = Server.CreateObject("ADODB.Recordset"
rst.CursorLocation = adUseClient
rst.Open strSQL,objConn
rst.ActiveConnection = Nothing
objConn.Close
Set objConn = Nothing
Set objCmd = Nothing
Do until rst.eof
.....
Loop
rst.close
set rst = nothing
where I can close the connection before starting to iterate through the recordset but the recordset remains
and using the getrows
Set rst = Server.CreateObject("ADODB.Recordset"
rst.CursorLocation = adUseClient
rst.Open strSQL,objConn
alldata= rst.getrows
rst.close
set rst = Nothing
objConn.Close
Set objConn = Nothing
Set objCmd = Nothing
numrows=ubound(alldata,2)
FOR rowcounter= 0 TO numrows
....
NEXT
where I can immedeately close the recordset and the data are loaded in an array.
I'm hence wondering what the difference is between the two and which one will give me the best performance? (my database is still to small to see an actual difference but will grow soon in size and number of users)
Thanks a lot in advance.
Greetz,
Dirk