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!

Using VB6.0 and need to access FoxP

Status
Not open for further replies.

07sprint

Programmer
Sep 18, 2003
25
0
0
US
Using VB6.0 and need to access FoxPro database. I downloaded vfpoledb. It still doesn't work.
 

FAQ222-2244

Simplest way is to create an ODBC DSN and if you do not see Microsoft FoxPro Driver (*.dbv) version 4 or greater then download MDAC 2.6 or 2.7 and 4.7 from MS. Then you can use ADO or DAO ODBC Direct with either a free table or database setup to access your FoxPro database.

Good Luck

 
I'm MDAC 2.8 and version is 4. What code should I use then.
My database is .dbf.
 
Try this:

' Sets up objects to be used
Set Fso = CreateObject("Scripting.FileSystemObject")
Set CONN = New ADODB.Connection
Set RS = New ADODB.Recordset

' Gets the drive and file names
DriveName = IIf(Right$(Fso.GetDriveName(lblInputFile.Caption), 1) = "\", Fso.GetDriveName(lblInputFile.Caption), Fso.GetDriveName(lblInputFile.Caption) & "\")
FileName = Fso.GetFileName(lblInputFile.Caption)

' Connects to the database
CONN.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & DriveName & ";" & _
"Extended Properties=dBASE IV;"

' Populates the recordset
RS.Open "Select * From " & DriveName & FileName, CONN, adOpenDynamic, adLockOptimistic, adCmdText

Swi
 
Error Message:
could not find installable ISAM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top