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

ACCESS FOXPRO DATABASE WITH VB6

Status
Not open for further replies.

07sprint

Programmer
Sep 18, 2003
25
US
ACCESS FOXPRO DATABASE WITH VB6

I get a error message:
[Microsoft][odbc.driver manger] data source not found and no default driver specified.

Set cn = New ADODB.Connection
cn.Open "Driver={Microsoft dBase Driver(*.dbf)};" _
& "DriverID=277;" _
& "dbg=D:\PerCap1;"
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.ActiveConnection = cn
rs.Open "Select * from PerCap2"
 
should be dbq=D:\PerCap1;

and not

dbg=D:\PerCap1;

Have you downloaded the latest version of MDAC?
 
I still get this error message:

[Microsoft][odbc.driver manger] data source not found and no default driver specified
 
I even try this code:

Dim strFilePath As String
strFilePath = "Data Source =D:\PerCap1\PerCap2.dbf"
Set cn = New ADODB.Connection
cn.Open "Provider = Microsoft.Jet.OLEDB.4.0;" & _
"strFilePath" & ";" & _
"Extended Properties=dBase IV;"

I get this Error Message:

Could Not Find Installable ISAM
 
Are your DBF's contained in a DBC? If so, you should use that type of access vs. just going at the standalone DBF files. Gives you more of a true client/server type access and you will have access to all tables in the DBC within one connection.

I'm doing the following from ASP and it works great. I had to install the VFP OLEDB provider which is not part of MDAC but you can get it from the VFP download page:
UNCDATAPATH is a constant.

Set objConnection = Server.CreateObject("ADODB.Connection")

strOpenString = "Provider=VFPOLEDB.1; " & _
"Data Source=" & UNCDATAPATH & "\PTRAK.DBC; " & _
"Mode=ReadWrite|Share Deny None; " & _
"Cache Authentication=False; " & _
"Encrypt Password=False; Collating Sequence=MACHINE "


objConnection.Mode = 16
objConnection.CursorLocation = 3

objConnection.Open( strOpenString )
 
I get Error Message:

Provider cannot be found.

It is in C:\Program files\common files\system\ole db
 
Try using the data conrol it has foxpro as an option as part of its connect property
 
How do you connect by using connect property.

new to this
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top