Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update SQL table from VFP table
Message
De
02/09/2015 06:29:30
 
 
À
31/08/2015 11:51:19
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
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:
01624144
Vues:
63
>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!)

Even here I'd point to Cursoradapter as well, as the option to modify the generated SQL through a hook might help a lot: if upsert/merge capability is beneficial in the update task (not clear from OP) or adding other options as described below.

@Chris: If you expect more than a 1-shot task in vfp, invest 1H in reading up on Cursoradapter and implementing with it, it is only slightly more work than Remote View and teaches you a better tool. If you expect more work with MS SQL server than vfp, Kevin's suggestion might be better for you. If you expect working with vfp and different data backends (even MS SQL and vfp tables) go for Cursoradapter.


>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform