> >*-- Make an OLEDB connection >oADO = CREATEOBJECT("ADODB.Connection") >oADO.ConnectionString = cMyConnectStringOLEDB >oADO.ConnectionTimeout = 30 > >*-- Make sure cursors are client-side >oADO.CursorLocation = 3 >oADO.Open > >*-- Use the OleDBFox Utilities >oOleDb = CREATEOBJECT("OleDbFox.Utils") > >*-- Dynamically create the SQL, but for this sample... >lcSQLTable = "employees" >lcSQLWhere = "" >lcSQLCommand = "SELECT * FROM " + lcSQLTable + lcSQLWhere >lcSQLRS = "csr" + lcSQLTable > >*-- Create recordset based on selected table >LOCAL oRS AS ADODB.Recordset >PRIVATE oRS >oRS = CREATEOBJECT("ADODB.Recordset") >oRS.ActiveConnection = oADO >oRS.LockType = 4 >oRS.Source = lcSQLCommand >oRS.Open > >oOleDb.RsToCursor(oRS, lcSQLRS) >*!*oRS.Close && If I close, oOleDb.CursorToRs() fails later >oRS = .NULL. > >*-- Change some data in the cursor and recreate the RS >REPLACE ALL ; > titleofcourtesy WITH STRTRAN(titleofcourtesy,".","") ; > IN (lcSQLRS) > >*-- Recreate recordset >oRS = CREATEOBJECT("ADODB.Recordset") >oOleDB.CursorToRs(oRS, lcSQLRS) > >*-- Reconnect recordset >*!*oRS.Close >oRS.ActiveConnection = oADO >oRS.Source = lcSQLTable && Can't do this when connected > >*-- Update recordset >oRS.UpdateBatch > >>