Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View to CA
Message
From
02/10/2006 15:48:09
 
 
To
02/10/2006 13:10:33
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01158608
Message ID:
01158671
Views:
29
This message has been marked as the solution to the initial question of the thread.
Ramil,

You need to set this:
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,
>First of all, we have a Remote View builder class and we access our 95% of the application data using views. We are trying to implement the CursorAdapter by just using the CursorAttach() method. However, the data changes don't get back to the underlying tables. Are we missing a property or setting? Should the xxxxCmd properties be defined?
>
>This is my bare bones test code. Take note of the TableUpdate() comments.
>
>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.
>
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform