Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use Transactions between FoxPro & SQL
Message
De
10/12/2004 23:08:06
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Use Transactions between FoxPro & SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
00968492
Message ID:
00968492
Vues:
66
Hi All,

I hope I can stay on point and clear on this one.

Ok, I have and application that maintains a master list that consists of two tables, the "Master" table and the "Attribute" table. These two tables are related by the Master table's primary key kMaster. These two table sit in a SQL database.

The application also has several match criteria definitions.

The application allows for the user to import data files. During this import the user first designates which import fields map to Master list fields and which will be appended as Attribute. The application then goes through the match definitions and checks to see if any of the import records already exist in the Master List. Records that exist in the Master List get updated with any new information while those that don't get appended to the Master List.

The append sequence goes like this:
- First I append the Master tables records, then issue a TableUpdate() command to get the SQL Server assigned primary keys for the new master table records.
- Then I update the new Attribute record foreign keys (kMaster) with the master record primary keys.
- Then I append the new attribute records to the Attribute table.

My question... Is there a way to put this all into a transaction that I will be able to rollback if something goes wrong between updating the existing records, appending the new Master table records and appending the new Attribute table records?

BTW, SQL Server is MSDE on the same computer and communication with FoxPro is handled via CursorAdapters accessing SQL Stored Procedures over ADO.

Aloha,

James
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform