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

Click here to load this message in the networking platform