>> Just out of curiosity, what are the results if
>> you add the code in bold below?
Just adding my two cents:
I see what you're getting at -- that while the ADO data transport is quicker, SPT takes the additional step of creating a cursor, which you can then access more easily (and probably more quickly) in VFP. It's a good point, but the results will vary significantly depending on the amount of data being returned.
A more important/practical question might be this: if you are going to need to use the returned data as a cursor (because you are going to set a relation to another cursor, use the VFP reporting tools, perform a subsequent SELECT etc.) does it make more sense to use SPT, or to use ADO followed by a dump into a cursor (via RS2Cursor or a similar process)?
Also, I have found ADO command objects to be more efficient that RS objects for the kind of data request in your example, so it is worth considering the Command object.
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
time1 = SECONDS()
oConn = CREATEOBJECT("adodb.connection")
oConn.Open("bbfsdsn","sa","")
oCustomerRS = CREATEOBJECT("adodb.recordset")
oCustomerRS.Open("SELECT * FROM patledger",oconn)
DO WHILE !oCustomerRS.EOF
x = oCustomerRS.Fields("somefield")
oCustomerRS.MoveNext()
ENDDO
time2 = SECONDS()
Time1 = SECONDS()
oConn = SQLCONNECT("BBFSDSN","sa","")
cSQL = SQLEXEC(oConn,"SELECT * FROM patledger","oCustomerRS")
SCAN
x = somefield
ENDSCAN
TIME2 = SECONDS()
Sylvain Demers
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell