How to connect to foxpro database?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I develope an application in VB.Net. I want to connect to foxpro database. I use the following code

Tr
Dim cnn As New OleDbConnectio
cnn.ConnectionString = "Provider=VFPOLEDB.1;" +
"Data Source=E:\FoxDB.dbc;
cnn.Open(
Catch e As System.Exceptio
MsgBox(e.Message
End Tr

Although database tables is contained in "E:\FoxDB" folder, the following error message is displayed: Invalid path or file name

Would you help me please

Thanks
Kim
 
Hi Kino,

It is Cindys stuff, however when I see this, than you have set a reference
to something strange
"Data Source=E:\FoxDB.dbc;"

That is in my opinion the FoxDB.dbc database in the mainroot from drive E:\

Should it not be something as
E:\FoxDB\FoxDB.dbc or whathever name that dbc has

However not my stuff but Cindy visits this newsgroup regulary however not
daily.

Cor
 
¤ Hi,
¤ I develope an application in VB.Net. I want to connect to foxpro database. I use the following code:
¤
¤ Try
¤ Dim cnn As New OleDbConnection
¤ cnn.ConnectionString = "Provider=VFPOLEDB.1;" + _
¤ "Data Source=E:\FoxDB.dbc;"
¤ cnn.Open()
¤ Catch e As System.Exception
¤ MsgBox(e.Message)
¤ End Try
¤
¤ Although database tables is contained in "E:\FoxDB" folder, the following error message is displayed: Invalid path or file name.
¤

The syntax looks OK to me. Is the E: drive a local resource and if not do you
have full access permissions to the network resource? Does the same code work if
the database source is on the C: drive?


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
In news: (e-mail address removed),
Kimo said:
cnn.ConnectionString = "Provider=VFPOLEDB.1;" + _
"Data Source=E:\FoxDB.dbc;"
Although database tables is contained in "E:\FoxDB" folder, the
following error message is displayed: Invalid path or file name.

Hi Kimo,

FoxPro tables can come in either of two formats. They can be "free" tables,
meaning that each table is independent of the others, or they can be part of
a "database container" which holds metadata and allows additional features
for the tables. If you see a file with a DBC extension then you've got a
database.

Here are two connection strings:

*-- Free table directory
Provider=VFPOLEDB.1;Data Source=C:\My Documents\Visual FoxPro
Projects;Password="";Collating Sequence=MACHINE

*-- Database Container
Provider=VFPOLEDB.1;Data Source=C:\My Documents\Visual FoxPro
Projects\Test.DBC;Password="";Collating Sequence=MACHINE
 
If "E:\FoxDB" is the folder shouldn't your data source be
"Data Source=E:\FoxDb\FoxDB.dbc;" ?

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
Back
Top