Unable to connect to Visual Foxpro DBC from .Net

G

Guest

I am unable to establish a conection to a Visual Foxpro 9.0 DBC from inside
of .Net 2005.

I have downloaded and installed the latest VFPOleDB driver.
Is there somnething missing in my code?

string connectionString = @"Provider=VFPOLEDB;Data
Source=C:\MyPath\CustomerData.dbc";
OleDbConnection myConnection = new OleDbConnection(connectionString);

try
{
myConnection.Open();
}
catch (OleDbException e)
{

}
 
P

Paul Clement

¤ I am unable to establish a conection to a Visual Foxpro 9.0 DBC from inside
¤ of .Net 2005.
¤
¤ I have downloaded and installed the latest VFPOleDB driver.
¤ Is there somnething missing in my code?
¤
¤ string connectionString = @"Provider=VFPOLEDB;Data
¤ Source=C:\MyPath\CustomerData.dbc";
¤ OleDbConnection myConnection = new OleDbConnection(connectionString);
¤
¤ try
¤ {
¤ myConnection.Open();
¤ }
¤ catch (OleDbException e)
¤ {
¤
¤ }

What is the error that is being generated?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
C

Cindy Winegarden

Hi Hayseed,

The following VB code works fine for me - it looks like your code should
work also.

Dim conn1 As New OleDbConnection( _
"Provider=VFPOLEDB.1;Data Source=C:\Temp\TestView.dbc;")
conn1.Open()

Try changing from VFPOLEDB to VFPOLEDB.1 and see if it helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top