Hello Jim,
Thanks for the link, it is an interesting way to access the database!
I did figure out how to access the fox pro version 8.0 database.
I found out that the particular fox databases I was accessing were closed
tables.
// Here is my corrected connection string.
const string connectString = "Provider=VFPOLEDB.1; Data
Source='C:\\MyTestDir';";
// My database connnection
protected OleDbConnection connection = new OleDbConnection();
connection.Open();
// The insertSQL string contains a SQL statement that
// inserts a new row in the source table.
OleDbCommand command = new OleDbCommand("Select * from testfile.dbf");
// Set the Connection to the new OleDbConnection.
command.Connection = connection;
// Get the records from the query.
OleDbDataReader reader = command.ExecuteReader();
So that is how I was able to access the fox database from ADO.Net
"Jim Rand" wrote:
> Microsoft OLE DB Provider for Visual FoxPro 9.0
> http://www.microsoft.com/downloads/d...displaylang=en
>
> Quick Details
> File Name: vfpoledb.exe
> Version: 1.1
> Date Published: 1/5/2006
> Language: English
> Download Size: 2.5 MB
>
>
> Overview
> The Visual FoxPro OLE DB Provider (VfpOleDB.dll) exposes OLE DB interfaces
> that you can use to access Visual FoxPro databases and tables from other
> programming languages and applications. The Visual FoxPro OLE DB Provider is
> supported by OLE DB System Components as provided by MDAC 2.6 or later. The
> requirements to run the Visual FoxPro OLE DB Provider are the same as for
> Visual FoxPro 9.0.
>
> Note: This version of the VFP OLE DB provider is the same version as the one
> included with Visual FoxPro 9.0 SP1
>
> "BartMan" <(E-Mail Removed)> wrote in message
> news:761428E3-96E5-4E16-AD5E-(E-Mail Removed)...
> > Greetings,
> >
> > I am devleoping a new application in C# which is suppose to perform a look
> > up of some data from a legacy database locally on the machine. The
> > problem
> > is that this data is stored in a Foxpro 8.0 DBF file. It seems like my
> > connection string works, but how do I get access to a specified .dbf file?
> >
> > // Here is my connection string.
> > const string connectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
> > Source=C:\\MyTestDir\\;Extended Properties=dBASE IV;User
> > ID=Admin;Password=";
> >
> > // My database connnection
> > protected OleDbConnection connection = new OleDbConnection();
> >
> > connection.Open();
> >
> > // How to get access to a specified dbf file?
> > // The file is located in C:\MyTestDir\testfile.dbf
> > // The following connection string does not work?????
> > const string connectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
> > Source=C:\\MyTestDir\\testfile.dbf;Extended Properties=dBASE IV;User
> > ID=Admin;Password=";
> >
> > Since I am not familiar at all with fox databases, I have a feeling it is
> > something simple I have missed. I am currently using visual studio 2005,
> > on
> > a windows xp sp2 computer.
> >
> > Thanks for any suggestions!
> >
>
>
>