all groups > dotnet odbc.net > april 2005 >
You're in the

dotnet odbc.net

group:

ODBC Microsoft dBase III driver and C#


ODBC Microsoft dBase III driver and C# Dave F.
4/26/2005 11:02:23 AM
dotnet odbc.net: I know, don't laugh! We have an old legacy app that uses dBase III+ files.
They will be replaced over the next couple of years with .NET apps and an
SQL Server database.

But for now I need to access the data using C# in an ASP.NET app. I can read
all the data just fine. The problem comes when I try to Insert a new row.
After the INSERT something seems to corrupt the header in the dBase file.
dBase III can't read the file. The error returned says that file is not a
dBase database file.

The same ODBC driver "Microsoft dBase Driver (".dbf")" works without a
problem in a Cold Fusion app. The problem occurrs using the ODBC framework
class in C#

Any ideas?

Re: ODBC Microsoft dBase III driver and C# Paul Clement
4/26/2005 1:07:21 PM
[quoted text, click to view]

¤ I know, don't laugh! We have an old legacy app that uses dBase III+ files.
¤ They will be replaced over the next couple of years with .NET apps and an
¤ SQL Server database.
¤
¤ But for now I need to access the data using C# in an ASP.NET app. I can read
¤ all the data just fine. The problem comes when I try to Insert a new row.
¤ After the INSERT something seems to corrupt the header in the dBase file.
¤ dBase III can't read the file. The error returned says that file is not a
¤ dBase database file.
¤
¤ The same ODBC driver "Microsoft dBase Driver (".dbf")" works without a
¤ problem in a Cold Fusion app. The problem occurrs using the ODBC framework
¤ class in C#

Have you tried using the Jet OLEDB Provider with the dBase ISAM instead?


Paul
~~~~
Re: ODBC Microsoft dBase III driver and C# Dave F.
4/28/2005 5:25:01 PM
Hi Paul,

I just tried your suggestion and end up with the same results. The good
thing is that ASP.NET will still open and display the contents even though
dBase III/III+ won't. According to MS it seems to be a problem with dBase
III/III+ only. If you insert a row into the file after 12/31/2000 using
anything but dBase III/III+ the date in the file header is changed and dBase
can't read it. Seems every other ODBC database tool can read the file. I'll
just use VFP to work with them.

I hope the dBase files will be phased out in the next year or so. They've
lived long enough.

Thanks,
Dave

[quoted text, click to view]

AddThis Social Bookmark Button