Information générale
Titre:
Use Transactions between FoxPro & SQL
Versions des environnements
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement