Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

writing .dbf file using VC++

I am trying to write a dBASE III table using Visual C++. I have obtained
information on structure of that table at www.inprise.com. The program writes
byte by byte file header, field descriptors and actual records using CArchive
class. It appears to work correctly and smoothly. However when I open the
resulting .dbf file in Visual FoxPro I can only see the column headers and
no data. I cannot figure out why it happens like this. This has become a
bottleneck in my work. Can you help

Tahir Aslam
[532 byte] By [Tahir Aslam] at [2007-11-10 12:51:52]
# 1 Re: writing .dbf file using VC++
If you are doing this at the byte level then you are re-inventing the wheel.
You should use a third party dBASE library such as CodeBase from Sequiter,
or use Microsoft's data access objects or ODBC. My company uses CodeBase
with great results.

Kevin Sikes
Software Engineer
ENCO Systems, Inc.

"Tahir Aslam" <tahir_aslam@mathtech-pk.com> wrote:
>
>I am trying to write a dBASE III table using Visual C++. I have obtained
>information on structure of that table at www.inprise.com. The program writes
>byte by byte file header, field descriptors and actual records using CArchive
>class. It appears to work correctly and smoothly. However when I open the
>resulting .dbf file in Visual FoxPro I can only see the column headers and
>no data. I cannot figure out why it happens like this. This has become a
>bottleneck in my work. Can you help
>
>Tahir Aslam
>
Kevin Sikes at 2007-11-11 20:40:38 >
# 2 Re: writing .dbf file using VC++
"Tahir Aslam" <tahir_aslam@mathtech-pk.com> wrote:
>
>I am trying to write a dBASE III table using Visual C++. I have obtained
>information on structure of that table at www.inprise.com. The program writes
>byte by byte file header, field descriptors and actual records using CArchive
>class. It appears to work correctly and smoothly. However when I open the
>resulting .dbf file in Visual FoxPro I can only see the column headers and
>no data. I cannot figure out why it happens like this. This has become a
>bottleneck in my work. Can you help
>
>Tahir Aslam
>

Hi,

did you write the number of records back into the header? This is a 32-bit
value in byte 4-7 of the header.

By the way, you could make your life a lot easier using the CodeBase library
(Sequiter), which does everything for you.

Regards Gerhard
Gerhard at 2007-11-11 20:41:32 >