Icon View Incident Report

Minor Minor
Reported By: Adam Hair
Reported On: 3/22/2011
For: Version 4.30 Build 3
# 3408 Closing and Then Re-Opening a TDBISAMEngine Component Can Cause List Index Out of Bounds Error

In my application when I choose to change the database location, I close down the TDBISamDatabase component, the TDBISamSession component, and the TDBISamEngine Component.

When I set the new database location, and attempt to open it, I get the error:

List index out of bounds (0)

I have traced this to the function TDataEngine.GetLocaleCharMap in the dbisamen.pas unit on line 4957.

When I break on this line and debug, FLocaleList.Recordcount returns 0.

procedure TForm1.Button1Click(Sender: TObject);
begin
DB.Connected := false;
dbs.Active := false;
DBE.active := False;
db.Directory := 'c:\temp\db';
DB.Connected := true;
DBT.open;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
DB.Connected := false;
dbs.Active := false;
DBE.active := False;
db.Directory := 'c:\temp\db2';
DB.Connected := true;
DBT.open;
end;



Comments Comments and Workarounds
The workaround is to simply not close and then re-open the engine component. In most instances this isn't necessary, such as in the example code.


Resolution Resolution
Fixed Problem on 3/23/2011 in version 4.30 build 4


Products Affected Products Affected
DBISAM VCL Client-Server
DBISAM VCL Client-Server with Source
DBISAM VCL Standard
DBISAM VCL Standard with Source
DBISAM VCL Trial

Image