PaulKelly
asked on
VB6 opening FoxPro 2.5 data base with code
Hi
I am using VB6 SP4
I have a DOS based program using FOX PRO 2.5 (DBF files with CDX index files )that I whish to get access to and modify data.
I whish to do all connections and data upgrades in code .
I can use code to open and modify MS ACCESS file (MDB) as follows.
referance MS ActiveX Data Objects 2.5 Library
Dim dbCon as New ADODB.Connection
Dim dbRst as New ADODB.Recordset
Dim JetOLEDB as string
JetOLEDB = "Provider = Microsoft.Jet.OLEDB.4.0;Da ta Source = c:\MyDataBase.mdb"
dbCon.open JetOLEDB
dbRst.open "SELECT Data.Table FROM Data" ,dbCon,adOpenstatic,adLock ReadOnly
With dbRst
.movefirst
etc
End with
dbRst.close
dbCon.close
etc
Is there a similar way to open Fox Pro 2.5 with code ??
I read that you must open Fox Pro with the correct version or they will not work for long.
Thank you for any help.
PK
I am using VB6 SP4
I have a DOS based program using FOX PRO 2.5 (DBF files with CDX index files )that I whish to get access to and modify data.
I whish to do all connections and data upgrades in code .
I can use code to open and modify MS ACCESS file (MDB) as follows.
referance MS ActiveX Data Objects 2.5 Library
Dim dbCon as New ADODB.Connection
Dim dbRst as New ADODB.Recordset
Dim JetOLEDB as string
JetOLEDB = "Provider = Microsoft.Jet.OLEDB.4.0;Da
dbCon.open JetOLEDB
dbRst.open "SELECT Data.Table FROM Data" ,dbCon,adOpenstatic,adLock
With dbRst
.movefirst
etc
End with
dbRst.close
dbCon.close
etc
Is there a similar way to open Fox Pro 2.5 with code ??
I read that you must open Fox Pro with the correct version or they will not work for long.
Thank you for any help.
PK
if you want the old basic code, email me at cymbsys@aol.com
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- PAQ'd and pts removed
Please leave any comments here within the
next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !
Nic;o)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Create an intermediate access database. Using file/import/link link the desired dbf files to your access database. Then you can access them using the method above.
MS Access will work as an intermediary to get to the data, assuming you have the necessary additional drivers installed that are on the MS Access install.
Also, if you are just interested in reading the dbf files, I can give you basic code that defines the dbf header and
reads the data. A dbf file is really just a flat file with fixed length records, and a variable length header at the begining of the file that describes the fields and has a record count.
For serious long term continuing use of these files, try
http://www.sequiter.com/
they have a product called codebase that can be used with vb to access and modify dbf files and indexes. I have used it in conjunction with Clipper databases and it has been totally transparent to the other older database code.