Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reading BTR's with no DDFs

276 views
Skip to first unread message

Rob

unread,
Sep 7, 2001, 10:03:49 AM9/7/01
to
I'm not really familiar with btrieve, but I have a task to
convert some existing .btr files to another format. I believe
that only .btr files are available. How can I go about reading
the data from these files? Nobody seesm to know the
record layout.

Am I doomed on this one?

Rob


Bernhard Mandl

unread,
Sep 7, 2001, 11:36:24 AM9/7/01
to
Am I doomed on this one?

Probably yes!

The btrieve files contain only information about index definitions. This
means you get the datatype and the position of the fields that are used in
an index. There is no information about the layout of the rest of the
record. It is probably easy to exctract text information from char columns,
but numeric columns are stored in different binary formats, depending on the
data type and without layout and data type information you are probalby
lost. The application may even store the data in any proprietary format, so
it may be impossible to create DDFs, even if you know the layout because the
data may be stored in ANY format.

Bernhard


Tom Klem

unread,
Sep 7, 2001, 1:59:06 PM9/7/01
to
I just downloaded the complete Btrieve Programmers manual in .pdf format,
and now I forgot where it is. Sorry. However, all the formats are thoroughly
explained in there. Also, you can recover records from a .btr file using
butil.exe, that command would look like:

butil -save [input.btr] [output.txt]

Also, butil -stat [input.btr] should give you the general record layout.

I agree that not having .ddf files is awful, but in the beginning when I
started using btrieve (c1983), there really wasn't much emphasis on having
data dictionaries. Sort of a job security thing for most of the programmers
who worked for me, and no amount of cajoling or threatening ever got the job
done.

Thankfully, for thge computer industry, the top down approach of twenty
years ago has been superceded by structures and documentation in most of the
shopw that I am aware of.

Anyway, I hope butil.exe helps, and the programmers manual.

Tom Klem

"Bernhard Mandl" <b.m...@eunet.at> wrote in message
news:99987342...@newsmaster-04.atnet.at...

LHarvey

unread,
Sep 7, 2001, 3:47:52 PM9/7/01
to
On Fri, 7 Sep 2001 10:59:06 -0700, "Tom Klem" <the...@666nospam.com>
wrote:

>I just downloaded the complete Btrieve Programmers manual in .pdf format,
>and now I forgot where it is. Sorry. However, all the formats are thoroughly
>explained in there. Also, you can recover records from a .btr file using
>butil.exe, that command would look like:
>
>butil -save [input.btr] [output.txt]

Kind of, the output.txt has the format of:
1) ascii representation of the number of bytes in the record
2) a comma
3) the raw binary data from the record (no data translations, no
commas, just x bytes of raw record)
4) a carriage return

If the record is readable, then you are in luck.
If it is just a string of seemingly incoherent bytes then...
hopefully some pattern in the data will be present to help.


>
>Also, butil -stat [input.btr] should give you the general record layout.

But only for those fields that fall on indices... probably a small
percentage of the record.


>
>I agree that not having .ddf files is awful, but in the beginning when I
>started using btrieve (c1983), there really wasn't much emphasis on having
>data dictionaries. Sort of a job security thing for most of the programmers
>who worked for me, and no amount of cajoling or threatening ever got the job
>done.
>
>Thankfully, for thge computer industry, the top down approach of twenty
>years ago has been superceded by structures and documentation in most of the
>shopw that I am aware of.
>
>Anyway, I hope butil.exe helps, and the programmers manual.

The current Pervasive.SQL 2000i Advanced Operations Guide has chapter
12 devoted to creating DDFs through the current create table wizard.


>
>Tom Klem
>
>"Bernhard Mandl" <b.m...@eunet.at> wrote in message
>news:99987342...@newsmaster-04.atnet.at...
>> Am I doomed on this one?
>>
>> Probably yes!
>>
>> The btrieve files contain only information about index definitions. This
>> means you get the datatype and the position of the fields that are used in
>> an index. There is no information about the layout of the rest of the
>> record. It is probably easy to exctract text information from char
>columns,
>> but numeric columns are stored in different binary formats, depending on
>the
>> data type and without layout and data type information you are probalby
>> lost. The application may even store the data in any proprietary format,
>so
>> it may be impossible to create DDFs, even if you know the layout because
>the
>> data may be stored in ANY format.

Yes, if it does not fall on an index, the data is just stuffed into
the record and returned. It may even be a proprietary scheme that
there is no data type for.

Leonard
>>
>> Bernhard
>>
>>
>

Bill Bach

unread,
Sep 7, 2001, 3:53:03 PM9/7/01
to
Check out my white paper on ODBC access, at:
http://www.goldstarsoftware.com/papers/btrvodbc.htm

This will give you a better idea of what you are up against. You're not
necessarily doomed -- but it might be somewhat expensive to get where
you want to go today...
Goldstar Software Inc.
Building on Btrieve(R) for the Future(SM)
Bill Bach
Bill...@compuserve.com
http://www.goldstarsoftware.com
*** Pervasive.SQL Service & Support Courses ***
Chicago: October 9-12, 2001 - See our web site for details!

0 new messages