Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update SQL table from VFP table
Message
From
31/08/2015 11:51:19
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
To
28/08/2015 13:04:30
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01623948
Message ID:
01624023
Views:
88
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform