0
我使用以下代码从基于WBTRV32.dll的BTrieve 6.15数据库文件中收集数据我在读取下一个数据库的位置返回错误代码22 - 是否是一个问题我的BTrieve文件没有固定列宽?c#Btrieve 6.15错误22
// 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
{
}
}
}