I use the following code to collect data from a BTrieve 6.15 database file based on the WBTRV32.dll I get allways the error code 22 back at the position reading the next dataline - is it a Problem that my BTrieve file has not fixed column width's?
// Open file
RecordBuffer dataBuffer = new RecordBuffer();
int bufferLength = System.Runtime.InteropServices.Marshal.SizeOf(dataBuffer);
short status = (short)BTRCALL(0, positionBlock, ref dataBuffer, ref bufferLength, fileNameArray, 0, 0);
if (status == 0) <== Here Status = 0
{
// Get first record
dataBuffer = new RecordBuffer();
status = (short)BTRCALL(12, positionBlock, ref dataBuffer, ref bufferLength, fileNameArray, 0, 0); //BGETFIRST
if (status == 0) <== Here Status = 0
{
...
}
// Get subsequent records
while (status == 0) // BReturnCodes.END_OF_FILE or an error will occur
{
dataBuffer = new RecordBuffer();
status = (short)BTRCALL(6, positionBlock, ref dataBuffer, ref bufferLength, fileNameArray, 0, 0); //BGETNEXT
if (status == 0) <=== Here Status = 22 data buffer length overrun
{
}
}
}