Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating a base table with a Cursoradapter
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Updating a base table with a Cursoradapter
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01345782
Message ID:
01345782
Vues:
61
Hello,

I'm trying to get a cursoradapter class to work with a detail table in a form, and I need some clarification on what properties need to be set for an update to work. I'm using VFP tables, so the cursoradapter setup should be fairly simple. Here's what I've done so far:

- In the business object's INIT() method, I place the following code:

loca1 = CREATEOBJECT("CursorAdapter")
loca1.DataSourceType = "Native"
loca1.SelectCmd = "SELECT Leaseclause.* FROM leaseclause WHERE Leaseclause.clink = lease.lease AND Leaseclause.ndisplayorder = 9 ORDER BY Leaseclause.ndisplayorder"
loca1.alias = "v_leaseclause"
loca1.CursorFill()

- When the form opens, the v_leaseclause alias is used as the datasource for a grid which successfully shows the multiple detail entries.

- I would like to have any changes made in the grid immediately posted back to the base table whenever the user moves off of the current record. I've tried using =TABLEUPDATE(.T., .T., "v_leaseclause") in a save button, but the changes aren't posting back to the base table.

I've left all of the default cursoradapter properties alone other than what is in the code above. What properties do I need to set to get the cursoradapter to issue an UPDATE to the base table?

Thanks in advance,

Ben
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform