Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View to CA
Message
From
02/10/2006 13:10:33
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
View to CA
Miscellaneous
Thread ID:
01158608
Message ID:
01158608
Views:
69
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.
ramil
~~ learning to stand still
Next
Reply
Map
View

Click here to load this message in the networking platform