Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issues creating DDF files for a btrieve 6.15 dat 1

Status
Not open for further replies.

ghaleon

IS-IT--Management
Jul 22, 2006
20
US
I'm having an issue when trying to build ddf files for one of about 9 dat files. All the others came over with no problem, but for some reason this ones not working correctly. The file itself is about 5MB big. It is for an old WG game called MajorMUD. It actually contains things called textblocks. At one point in time someone created a viewer, so I can see what the file is "supposed" to contain, but as soon as i use the pervasive builder on it, it only displays 2 fields with the following properties:

Offset Size Btrieve Type
0 18 Unsigned Binary
18 6 Unknown

Im fairly new at the whole btrieve thing to be honest with you. Im doing this so that I can create dynamic php pages from the dats using odbc/sql that pervasive 9.5 supplies.

If there is anyone that might be able to help me, I could send the dat files to you so that you could look at them. I would also be able to send you either a screenshot, or a copy of the viewer i use with the dats.

Thanks in advance, you guys are my last hope.
 
You have to define the fields exactly down to the byte level. For example, if your record is 100 bytes long, you have to account for each and every byte. What I would suggest is try to find the exact record structure so you can then use the DDF Builder or the Create Table Wizard or a CREATE TABLE SQL statement or a third party tool.
The Create Table Wizard only displays the indexes I believe.
Post a BUTIL -STAT of the data file.
If you've got the exact record structure including data types, post that too.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 
The problem is all I have on these dat files are the dat files. I have no info on them what so ever and I am very new with btrieve. Here is the butil stat

This is all I get from the file stats

File Version ?.?
Page Size 2048
Page Preallocation No
Key Only No
Extended No
Total Number of Records 2549
Data Compression No
Variable Records No
Available Linked Duplicate Keys 0
Balanced Key No
Total Number of Keys 1
Total Number of Segments 1
 
here you go

File Version = 6.00
Page Size = 2048
Page Preallocation = No
Key Only = No
Extended = No

Total Number of Records = 2549
Record Length = 24
Record Compression = No
Page Compression = No
Variable Records = Yes
Variable-Tail Allocation Tables = No
Blank Truncation = No
Free Space Threshold = 5%

Available Linked Duplicate Keys = 0
Balanced Key = No
Log Key = 0
System Data = No
Total Number of Keys = 1
Total Number of Segments = 1

Key Position Type Null Values* ACS
Segment Length Flags Unique Values
0 1 1 18 Unsigned -- 2549 --

Legend:
< = Descending Order
D = Duplicates Allowed
I = Case Insensitive
M = Modifiable
R = Repeat Duplicate
A = Any Segment (Manual)
L = All Segments (Null)
* = The values in this column are hexadecimal.
?? = Unknown
-- = Not Specified

The command completed successfully.
 
From the looks of it, there are only two fields. One is an 18 byte unsigned and the other is 6 bytes. Those 6 bytes are something you're going to have to determine. They could be one field or multiple fields. For example, the data could be a 4 byte integer and a 2 byte integer, or it could be a 6 byte string. What does your viewer show?
We can't post email addresses on the site but you can post the data file on a web site if you want us to look at it.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
 

Here is a link to 2 screenshots and the dat file itself.

The screenshots show a view of the data itself. As you can see there are 3 integer fields and a forth one with text. The forth one doesnt come up at all. The only other files in the viewer are w32mkde.exe and wbtrv32.dll version 6.15.

If you need a copy of the viewer I can supply that too.

Thanks for your help!
 
The 24-byte data record probably contains the block number, part number, and links information, but how that's exactly stored I can't really say. They could be two 8-byte unsigned integers followed by a 2-byte unsigned integer, all combined to make up the 18-byte key. I don't see anything readable or a pattern in the other 6 bytes of the record.

The text is all stored in the variable portion of the record, which is 2000 bytes long in every record. However, it must be encoded text because it also is not readable.

Try doing a BUTIL -RECOVER to dump the data out to a flat file, then open up the flat file in Notepad. This shows you the raw data in the format:
<record length>,<record image>
For this file, the record length is 2024 for every record, so you'll see 2024 then a comma then 2024 bytes of data.

The application that uses this file obviously knows how to interpret the 2000 bytes of variable length data into a text display. Since the viewer you show in your jpg's has all kinds of buttons for changing color and other stuff, I'm guessing all that is encoded in the 2000 bytes as well.

There's not much more I can tell you about the data.



Linda
Pervasive Software
 
If you need to build the DDF files you can take a look at BtSearch at It helps you analyze the data structure and then build the DDF files.



Gil
 
Thanks guys I got it to work! When I was using pervasive's builder and i tried to set the record offset to 24 with a length of 2000 the whole bar turned red, so I originally figured this was bad and it would error out. Well turns out I did it and it worked, then it was just a matter of decoding the text.


Thanks you guys rock!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top