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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

B_STAT

Status
Not open for further replies.

senorbuckwheat

Programmer
Jul 12, 2002
17
US
I am back! Just when I think I have this figured out, something else pops up.

I am using the BTRV(B_STAT...) trying to find the record count. But following the Pervasive file layout for the returned data buffer, the number of records field is garbage. The record length, page size, and number of indexes come out fine as does the key specifications.

What am I missing? Does anyone have a C/C++ struct for this buffer? If I run the statistics report using the Btrieve maintenance tool, it shows the proper information.

Has this buffer layout changed between versions? I am using 2000i.


Thanks again.
 
The structure for the stat hasn't changed. In terms of the structure, check out the sample included with the Pervasive SDK. THere is a STAT operation in the sample in the SDK\INTF\C directory.
mirtheil@mirtheil.com
Custom VB and Btrieve development.
Certified Pervasive Developer
Certified Pervasive Technician
 
I have seen the B_STAT structure in the sample programs. I have pasted it below. But when you look at the API for B_STAT, PVSW\SDK\doc\prog_api.chm, the below structure doesn't account for all fields returned such as file version, number of records to name a few. Plus there are other differences, such as indexCount shows as taking two bytes in the structure when the API states the length is 1 byte. I mapped the API layout to a structure in the program and did not get the expected results.

Thank you.

***********************************************************
Type definitions for Stat/Create structure
typedef struct
{
BTI_SINT recLength;
BTI_SINT pageSize;
BTI_SINT indexCount;
BTI_CHAR reserved[4];
BTI_SINT flags;
BTI_BYTE dupPointers;
BTI_BYTE notUsed;
BTI_SINT allocations;
} FILE_SPECS;

typedef struct
{
BTI_SINT position;
BTI_SINT length;
BTI_SINT flags;
BTI_CHAR reserved[4];
BTI_CHAR type;
BTI_CHAR null;
BTI_CHAR notUsed[2];
BTI_BYTE manualKeyNumber;
BTI_BYTE acsNumber;
} KEY_SPECS;

typedef struct
{
FILE_SPECS fileSpecs;
KEY_SPECS keySpecs[5];
} FILE_CREATE_BUF;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top