Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to handle this - SQL writing to VFP?
Message
De
04/12/2006 20:13:59
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
 
 
À
04/12/2006 18:55:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
01174803
Message ID:
01174813
Vues:
10
If you are submitting the transactions to SQL Server from a FP app, you could create a SQL Server SP to which you submit the transaction, with the SP returning the new qty as its resultset so you could apply it immediately as part of your existing synchronization. Obviously that would not work if a transaction can update more than one qty at once, or if qty in SQL Server can be updated by some other process. Also, it might not be 100% reliable if failure occurs between submitting the transaction and updating the qty in the dbf.

You could consider using a SQL Server trigger to insert a record in a "qtyforFP" table whenever a qty is updated in SQL Server. Then every 30 seconds you take a "select *... order by ttimestamp" snapshot of the qtyforFP table from FP, then scan the resultset updating the qty in the dbf and deleting the qtyforFP record. Not much can go wrong there- at worst you might update a qty in the dbf more than once if there is a failure between updating it in the dbf and deleting the SQL record.
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform