Problems reading Visual FoxPro table

Cavar

Well-known member
Joined
Sep 5, 2006
Messages
60
Programming Experience
5-10
I have a .DBF file that Windows is identitfying as a Visual FoxPro table and I am having problems reading data from it.

The data folder contains the following files:

100046986.DBF 4kb
100046986.I00 175kb
100046986.NDX 1kb
100046986I.N00 1kb
100046986R.NDX 1kb

I am trying to automate a process that will extract TIFF images from the data table to be able to merge them into a PDF for a client. The client provided a utility to ready the data tables and view/export the data. It's a windows app and there's a lot of steps to export the images to PDF.

It appears that the TIFF images are stored in the .I00 file, since the size looks similar to the size of the files extracted by the clients utility.

I am using the following code to connect to the table, which is successful, but I cannot select data with out getting errors.

VB.NET:
Dim dt As New DataTable() 

Using conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\data\;Extended Properties=dBASE IV;User ID=Admin;Password=;") 
    conn.Open() 
    
    Using cmd As New OleDbCommand("select * from C:\data\100046986.DBF", conn) 
        dt.Load(cmd.ExecuteReader()) 
    End Using 
End Using

When I try the code above I get an error stating "Syntax error in FROM clause".

If I change...

VB.NET:
Using cmd As New OleDbCommand("select * from C:\data\100046986.DBF", conn)

to...

VB.NET:
Using cmd As New OleDbCommand("select * from 100046986.DBF", conn)

...I get an error stating "The Microsoft Jet database engine could not find the object '100046986.DBF'".

I have tried the file with and without the .DBF extention and I still get the above errors.

Could the .DBF file possible be password protected and as a result that is causing the errors? I am not sure if this is the issue if I can open the connection though.

Does anyone have any thoughts on this?

Thanks,
CT
 
Back
Top