DBF to CSV conversion using C#

Hi,

I am converting a dbf file into csv file using C#. My program is working fine for file having fewer columns in dbf file. If the dbf file has more than 255 columns, I am getting the error "FILENAME" is not a table.


I am using Visual foxpro OLEDB friver. I downloaded drivers from

http://www.microsoft.com/downloads/details.aspx?familyid=e1a87d8f-2d58-491f-a0fa-95a3289c5fd4&displaylang=en


I tried with Microsoft dBase ODBC and OLE DB drivers. Both are giving the errors.


With OLEDB:
----------------


The Microsoft Jet database engine could not find the object 'Temp.dbf'.  Make sure the object exists and that you spell its name and the path name correctly


With DBASE
------------------
ERROR [42S02] [Microsoft][ODBC dBase Driver] The Microsoft Jet database engine could not find the object "Temp.dbf'.  Make sure the object exists and that you spell its name and the path name correctly


File Temp.dbf is existing.


Initially, I tried with these drivers. But I was getting this errors and then tried with visual foxpro drivers. It is working with other files except one file which has 261 columns.


Connection strings are :
----------------------------

string inputDir = @"C:\Temp_DBF"   //my dbf file location
string fileName = "Temp.dbf";      // Tried with Temp also.
string dataSource = inputDir + "\\" + fileName;

string strConn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + inputDir + ";Extended Properties=dBASE IV";

//string strConn = @"Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=" + inputDir + ";";
               
//string strConn = @"Provider=VFPOLEDB.1;Data Source=" + dataSource + ";Persist Security Info=False;";


I tried with dBase 5.0 also, I am getting the error "Could Not Find Installable ISAM"



You can find more information here...
http://www.experts-exchange.com/Microsoft/Development/.NET/Visual_CSharp/Q_22744623.html




Any Help.
Thanks In Advance!!!
sormvAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Frosty555Commented:
In FoxPro, a standalone table has a limit of 255 fields (or 254 if one or more of your fields is allowed null values). If you open a dbf with more than 255 fields in FoxPro, it comes back with a "not a table" error.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sormvAuthor Commented:
Hi Frosty555,


I am gettiing the error. what is the solution for this. How to read dbf file with more than 255 columns.


Thanks..
sormvAuthor Commented:
Any Idea.. how to read clipper dbf files using clipper odbc drivers..

Thanks...
pcurtis_expertCommented:
http://www.vistasoftware.com/default.asp
Try the link above.  They have a 30day free trial.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.