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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

okay reposting because I didn't get any response DBF ?

Status
Not open for further replies.

peairs01

MIS
Oct 3, 2001
8
0
0
US
I have a project using DAO 3.6 to read an Access database, but there I'm trying to add some functionality to the program to read FoxPro 2.5 tables.

I tried the
dim db as Database
Dim rs as Recordset

mydb = "c:\data"
Set db = Workspaces(0).opendatabase(mydb,0,0,"FoxPro 2.5")
and am getting the error 3170 "Could not find Installable ISAM"

If I move the function to a seperate project it runs fine, I just can't get it to run inside the existing program.

PLEASE HELP,, have looked everywhere for a clue.

 
I have not used DAO with a FoxPro Database, but I have used ADO.

The following is an example of opening a connection (with a pack statement as well)

Dim Cnn As ADODB.Connection

Set Cnn = New ADODB.Connection
Cnn.Open "Driver={Microsoft Visual FoxPro Driver};" & _
"SourceType=DBF;" & _
"SourceDB=C:\FoxDatabase;" & _
"Exclusive=Yes;"

Cnn.Execute "PACK Products"

Note that you are connecting to the directory which contains the DBFs, and not any particular table in the directory. Use the RecordSet object for individual tables on this same connection handle.

Also, this example uses an exclusive connection - required for the PACK command. Under normal circumstances, the Exclusive parameter would be set to No.
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein


 
dim db as DAO.Database

mydb="\\FoxPro\Data\AP"

Set db = Workspaces(0).Opendatabase(mydb,False,False,"FoxPro 2.5;")

Note: It shouldn't make a difference but I've added a semicolon ; to "FoxPro 2.5;"
If you can get it to run in the other projects, then I would check and compare the references used for DAO in both projects. Also, are both on the same machine?


 
It may be easier to create a Link to the external table. Then you can access it like a normal MDB table. (Note: you cannot link .dbf files directly in FoxPro 3.0)
 
In order to do this you must have DAO 2.5/3/51 Compatibility library and not DAO 3.6

I have never been able to access a foxpro dbf with 3.6 - tried everything. But, it works peachy with the compatibility library
 
Good point - you may be right! But then I would first try it just using the DAO 3.51 Object library instead using the 2.5/3.51 Compatibility library.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top