Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
View to CA
Message
De
02/10/2006 13:10:33
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
View to CA
Divers
Thread ID:
01158608
Message ID:
01158608
Vues:
70
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform