Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatic dBase Connection
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00256910
Message ID:
00257399
Views:
17
>As I had said, I am already using sqlstringconnect() and I can bring up a read only cursor. I was hoping for something more that would actually let me access the dBase tables to write to them as well as read from them. Something on the order of:
>
>oConnection = createobject("adodb.connection")
>
>Since dBase has an odbc driver why can't I open a dBase table and work it as if it were a Fox table. In Access, I can open a dBase table make edits, do whatever I want, and then save the table. Why can't I do the same within FoxPro?
>

An ODBC connection is not the same as connecting to a native VFP table; you can update a dBASE table through an ODBC connection, but you have to create the connection and either use SQL Passthrough or Remote Views to reference the table in this fashion. If you create the necessary DBC, remote views will permit you to work with the dBASE table through the remote view as if it were a native table (eg you'd USE the view, and if your remote view were established as updatable, you could read from and write to the table.)

VFP can work with ADO recordsets; working with ADO recordsets using native VFP table operations, including replace/append type opoerations, requires the use of VFPCOM or a similar utility to move data between the ADO recordset and a VFP cursor. VFPCOM can be downlaoded from http://msdn.microsoft.com/vfoxpro/downloads; there are other programs that can make the necessary moves between ADO and VFP cursors - one such is available from Rick Strahl's web site, http://www.west-wind.com

VFP can read the DBF from dBASE, and write to it as well, at least with some version of dBASE through the standard xBASE USE command; VFP's index scheme is not the same as dBASE's, and so dBASE's index files won't be updated unless the dBASE file is accessed via ODBC. You might try accessing the DBF directly if updating the dBASE index files isn't an issue.

I'm afraid that you may be much happier accessing dBASE tables from Access or another product that does not require you to establish a connection and work with remote views.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform