lcSide = "SERVER" *lcSide = "CLIENT" *-- Create Recordset object with some default settings loRS = CREATEOBJECT("ADODB.Recordset") loRS.CursorType = 3 && adOpenStatic loRS.CursorLocation = 3 && adUseClient loRS.LockType = 4 && adLockBatchOptimistic IF lcSide = "SERVER" loRS.CursorLocation = 2 && adUseServer ENDIF *-- Create Connection object with some default settings loConn = CREATEOBJECT("ADODB.Connection") loConn.CursorLocation = 3 && adUseClient loConn.CommandTimeout = 0 loConn.ConnectionTimeout = 0 IF lcSide = "SERVER" loConn.CursorLocation = 2 && adUseServer ENDIF *-- Set location of VFP tables as the DataSource lcVFPDataSourceFullPath = "C:\Work\Dev\Test\dbfs\" *-- SQL Command to execute lcSQLCommand = "Select * from master" lcOLEConnString = "Provider=vfpoledb;" ; + "Data Source=" + lcVFPDataSourceFullPath + ";" ; + "Mode=ReadWrite|Share Deny None;" ; + "Collating Sequence=MACHINE;" ; + "Password=''" *-- Set the ConnectionString and Open connection loConn.ConnectionString = lcOLEConnString loConn.Open() *-- Set up the Recordset and Open loRS.Source = lcSQLCommand loRS.ActiveConnection = loConn loRS.Open() *-- Close any previous instance of our result cursor USE IN SELECT("csrResult") *-- Convert the Recordset to a cursor lCA = CREATEOBJECT("CursorAdapter") lCA.DataSourceType = "ADO" lCA.Alias = "csrResult" lCA.CursorFill(,,,loRS) BROWSE *-- Scrolling to the bottom of the cursor after fetching is complete *-- will show only 12337 records *-- Interesting Note: With server-side, scrolling to the bottom shows 12438 rows *-- and the last row has a slew of non-printing characters in the text fields, *-- blanks in numeric and dates... *-- Loop through Recordset loRS.MoveFirst i = 1 DO WHILE NOT loRS.EOF WAIT WINDOW "Recordset row: " + TRANSFORM(i) NOWAIT NOCLEAR i = i + 1 loRS.MoveNext && Client-side will fail after record 12337, Server-side OK ENDDO ? "Recordset Rows: " + TRANSFORM(i-1)