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
{
}
}
}