Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to VFP database 1

Status
Not open for further replies.

123FakeSt

IS-IT--Management
Aug 4, 2003
182
Does anyone know what the "Extended Properties" should be to set up a connection to a VFP database?

Code:
Function OpenDBFConn(Path)
  Dim Conn: Set Conn = CreateObject("ADODB.Connection")
  Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                   "Data Source=" & Path & ";" & _
                   "Extended Properties=""FOXPRO 8.0;"";" 
  Set OpenDBFConn = Conn
End Function


The early bird gets the worm, but the second mouse gets the cheese.
 
123FakeSt,

Have to use ODBC for that part.
[tt]The database type is specified in the Extended Properties property of the Connection with ADO. The following table lists the strings to use to specify which ISAM to open.

Database String
dBASE III dBASE III;
dBASE IV dBASE IV;
dBASE 5 dBASE 5.0;
Paradox 3.x Paradox 3.x;
Paradox 4.x Paradox 4.x;
Paradox 5.x Paradox 5.x;
Excel 3.0 Excel 3.0;
Excel 4.0 Excel 4.0;
Excel 5.0/Excel 95 Excel 5.0;
Excel 97 Excel 97;
Excel 2000 Excel 8.0;
HTML Import HTML Import;
HTML Export HTML Export;
Text Text;
ODBC ODBC;
DATABASE=database;
UID=user;
PWD=password;
DSN=datasourcename;

[blue]Note that if you are migrating from DAO 3.5 or earlier with the FoxPro ISAM to ADO with the Microsoft Jet Provider, you will need to use Microsoft Visual FoxPro ODBC Driver because Microsoft Jet 4.0 does not support the FoxPro ISAM.[/blue]
[/tt]
(ref
Hence, something like this in construction.
[tt] "Extended Properties=""ODBC;DATABASE=[blue]...etc...;[/blue]"";" [/tt]
(Experimenting a bit to get it right. I'm interested in knowing the final form it takes for you.)

regards - tsuji
 
dilettante,

Maybe installing foxpro on the m/c, it's got odbc and those registry keys written auto. (This is what I conclude from looking at my m/c.) The situation I do not see clearly is whether on the m/c without foxpro installed, these entries can be managed to establish using odbc data source control panel? Or whether the whole thing which exists on my m/c is written onto with or without foxpro package?

- tsuji
 
I'm not sure. My machine has never had FoxPro installed and yet the keys show up under Jet 3.5 here. I assume the web page I cited is simply showing a way to enable software provided under Jet 3.5 to Jet 4.0, though I can't say whether it would function properly.

My machine does list FoxPro drivers in the Data Source management control panel applet though - so I assume FoxPro support exists on non-FoxPro machines.

I suppose I should have stated that FoxPro can (apparently) be made to work with Jet 4.0 instead of mentioning OLEDB. I must have gotten focused on that because I rarely use ODBC any longer except in specific circumstances.

In any case FoxPro and Jet 3.5 are available here right now (WinXP SP2).
 
dilettante,

Thanks for the info. I had it there, and rare to practically never used it! Good lead for a more focused look into it when time comes. Thanks.

- tsuji
 
Things would be great if the connection was static. I'm dealing with several hundered seperate databases.

I need to input a location (from 0001 to 1000) and then make a connection to that database (i.e serverxxxx\vfp\db) so create a static ODBC DSN to use would not work.

That is why I am having difficulty with this.

The early bird gets the worm, but the second mouse gets the cheese.
 
Finally got it to work, had to map a drive to the server dyunamically. Thanks for the link dilettante.

The early bird gets the worm, but the second mouse gets the cheese.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top