tags:

views:

1747

answers:

1

Hi,

I am having a lot of trouble using .dbf files. I have an application written in C# that reads from .DBF files and then exports them to another database. I've tried using the Microsoft dBase driver but it's not reading all of the .DBF files that I need to, meaning that I can retrieve data from only two of the five .DBF files, Visual Studio is telling me the other .DBF files don't exist and it keeps saying the my input string is too large. There are some Microsoft Visual Fox Pro drivers but every time I choose one of those, Visual Studio is telling me that it couldn't make a connection. The worst part is that this application will be used on client machines that I don't have access to. How do I keep the ODBC data source so that my application will work on other peoples machine? I am very unfamiliar with .DBFs, have no idea what driver works best, and need someone to walk me through the steps.

+1  A: 

Are these DBF files produced by Foxpro, perchance? If they've been created by a version of Foxpro greater than 7 hten the ODBC driver won't read them anyway. In that case, use the OLE-DB driver instead - which may work with your files whatever their source, worth a try as using OLE-DB gets away from the ODBC data source fiasco.

There's some sample code (VB unfortunately) here.

Stuart Dunkeld
Hi, this does work and I've added this dll to my class library. The only problem is when I send this off to the client, it says that their local machine doesn't contain that provider. How can I do this on a client machine?
jumbojs
There's an installer merge module on the download page, you'll need to package it into a little MSI to install it on the client.
Stuart Dunkeld