Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update SQL table from VFP table
Message
De
31/08/2015 11:51:19
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
 
 
À
28/08/2015 13:04:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01623948
Message ID:
01624023
Vues:
87
Chris,

>>I need to update a SQL Server table with values from a VFP table.

VFP's Remote View provides an easily reproducible and accessible mechanism to do this. Even with no experience a developer can create an updateable RV against a SQL Server table in as little as a minute. After that you can simply USE the Remote View NODATA (use the NODATA because unless you specify a filter in the RV, it will pull across the whole SQL table!)

Do the fields in SQL Server match or approximately match the dbf fields?

If so, create an updateable VFP Remote View and simply append the dbf whenever you need to.

If the match is not perfect, either get the dbf into a cursor/dbf that does match the SQL table and then append, or insert a set of expressions into the RV cursor.

Watch out for datetime fields where VFP allows blank values but SQL Server does not. It's easiest to transfer a NULL if that happens.
"... 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