Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating a table from a moverbox
Message
De
24/10/2008 11:14:31
 
 
À
24/10/2008 08:31:19
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01356849
Message ID:
01356938
Vues:
19
>Got a moverbox where the left side (all items) is populated from a table. The left side contains what has been selected and is populated from a second table that contains the selected items. Then the user can move things between the two sides and when they are done, a cursor of the selected items is created. Populating the lists when the user comes into the form is easy. Moving items between the left and right sides is easy. My problem is how to update the second table that contains the selected items from the cursor. Sounds simple, but the issue is that there could be a set of records already in the table, but now different than the cursor. I need to scan through the cursor and look for a record in the table, then add it if it doesn't exist, but how do I handle ones that are in the table, but are not in the cursor? I guess I could delete everything and just append from the cursor, but that seems sort of heavy-handed.

If find the item is not in the resulting table, locate a deleted record, recall it and overwrite the content. If no deleted record then insert it. In addition to just deleting the record, I generally Blank the record to prevent bad data laying around in the deleted record. All this method aids in preventing the table blot. I generally have a general routine that a pass a object (from Scatter) as a parameter. This allows for the Gather to work even if there is a primary key (which I delete from object it does not get overwritten with an old.
Greg Reichert
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform