loSchemaRS = CREATEOBJECT("ADODB.Recordset")before calling OpenSchema() doesn't seem to make a difference.
CursorAdapter.CursorFill( [ lUseCursorSchema [, lNoData [, nOptions [, Source ] ] ] ] )
I have a generic function that coverts any other RS to a cursor via a CA without any problem... except for the RS returned by OpenSchema that is... I've even tried changing the nOptions flag to -1 and it doesn't make a difference.>> lcConnString = 'Provider=SQLOLEDB.1;' ; >> + 'Persist Security Info=False;' ; >> + 'Integrated Security=SSPI;' ; >> + 'Initial Catalog=Northwind;' ; >> + 'Data Source=(local)' >> >> * Make an OLEDB connection >> goConn = CREATEOBJECT("ADODB.Connection") >> goConn.ConnectionString = lcConnString >> goConn.ConnectionTimeout = 30 >> >> * Make sure cursors are client-side >> goConn.CursorLocation = 3 && adUseClient >> goConn.Open() >> >> LOCAL ARRAY laADCRIT[4] >> LOCAL loSchemaRS as ADODB.Recordset >> #DEFINE adSchemaTables 20 >> >> laADCRIT = .NULL. >> laADCRIT[4] = "TABLE" >> >> loSchemaRS = goConn.OpenSchema(adSchemaTables, @laADCRIT) >> >> loCA = CREATEOBJECT("CursorAdapter") >> loCA.Alias = "csrSQLTbls" >> loCA.DataSourceType = "ADO" >> loCA.DataSource = loSchemaRS >> loCA.BufferModeOverride = 5 >> lbOk = loCA.CursorFill( .F., .F., 0, loSchemaRS ) >> IF NOT lbOk >> AERROR(laErr) >> MESSAGEBOX("Error: " + TRANSFORM(laErr[1,2])) >> ENDIF >> >> loCA.CursorDetach() >> >> IF USED("csrSQLTbls") >> BROWSE FIELDS table_name >> ENDIF >>