#Define SQLCONNECTION "Provider=SQLOLEDB.1;Integrated Security=SSPI;"+; "Persist Security Info=False;"+; "Initial Catalog=Northwind; Data Source=servernamehere" *!* ADO CursorAdapter oXC1 = Createobject('xcADOUpdatable', "vcustomers", SQLCONNECTION, ; "select * from customers",; "Customers",; "CustomerID",; "CustomerID, CompanyName, ContactName, ContactTitle",; "CustomerID customers.CustomerID, "+; "CompanyName customers.CompanyName,"+; "ContactName customers.ContactName,"+; "ContactTitle customers.ContactTitle") CursorSetProp("Buffering",5,'vcustomers') Browse Title 'Before modification' If ( !Tableupdate(2,.T.,'vcustomers') ) oXC1.DispError() Else oXC1.CursorFill() Browse Title 'After Tableupdate' Endif Define Class xcADOUpdatable As CursorAdapter AllowUpdate = .T. AllowInsert = .T. AllowDelete = .T. Procedure Init Lparameters tcAlias,tcConn, tcSQL,tcTables,; tcKeyFieldList,tcUpdatableFieldList,tcUpdateNameList This.AddProperty('oConn', Newobject("ADODB.Connection")) This.AddProperty('oRS', Newobject("ADODB.Recordset")) With This.oConn .ConnectionString = tcConn .Mode = 16 && adModeShareDenyNone .Open() Endwith With This.oRS .ActiveConnection = This.oConn .LockType=3 && adLockOptimistic .CursorLocation = 3 && adUseClient .CursorType = 2 && adOpenDynamic Endwith With This .Alias = tcAlias .Tables = tcTables .KeyFieldList = tcKeyFieldList .UpdatableFieldList = tcUpdatableFieldList .UpdateNameList = tcUpdateNamelist .WhereType = 1 .UpdateType= 1 .SendUpdates = .T. .DataSourceType = "ADO" .Datasource = This.oRS .SelectCmd = tcSQL .CursorFill() Endwith Endproc Procedure DispError Local Array errors(1) Local lcError Aerror(errors) lcError = 'Error--------------' For ix=1 To 7 lcError = lcError + Chr(13)+Transform(errors[ix]) Endfor lcError = lcError + Chr(13) + 'Error--------------' Messagebox(lcError) Endproc EnddefineCetin