oCA.DataSourceType = "NATIVE"
Of course, if you're going against a different backend like SQL Server, you will have to set:oCA.DataSourceType = "ODBC" oCA.DataSource = a valid connection handle>Hi all,
>if !file('myTable.dbf') > close databases all > create database myData > create table myTable (pkfld i primary key, datafld c(10)) > insert into myTable values (1,"Hello") > insert into myTable values (2,"World") > create sql view myView as select pkfld, datafld from myTable >endif >use myView >select myView >cursorsetprop("KeyFieldList","pkfld") >cursorsetprop("UpdatableFieldList","datafld") >cursorsetprop("UpdateNameList","pkfld myTable.pkfld, datafld myTable.datafld") >cursorsetprop("SendUpdates",.t.) >browse title "1. Make some changes to the DataFld. Works." >tableupdate(.t.,.t.) && changes ARE updated to underlying table. > >local oCA as CursorAdapter >oCA = createobject('CursorAdapter') > >oCA.CursorAttach('myView',.t.) >browse title "2. Make some changes to the DataFld. Using CA does not work." >tableupdate(.t.,.t.) && changes ARE NOT updated to underlying table. > >oCA.CursorDetach() >browse title "3. Make some changes to the DataFld. Detached from CA and works again." >tableupdate(.t.,.t.) && changes ARE updated to underlying table. >