Topic: LoadFromDatabase Error
To luckylazarus:
In my previous post I mention two bugs found in code version 0.32 and the first is still present in new version (0.33):
BUG CODE: //--> index is out of bounds
{ Storage Version }
FStorageVersion := StorageInfoStrings[1];
FIXED CODE:
{ Storage Version }
FStorageVersion := StorageInfoStrings[0];
This message is prompting every time when I open database:
Msg1044 = 'TSqlitePassDatabase.DataTypeOptions.LoadFromDatabase: Error while loading data from database. '
+ 'The "SqlitePass__DbSettings" table is corrupted or was created using an old version of this component. '
+ ' Do you want to remove the "SqlitePass__DbSettings" from your database ? (A new table will be created on database closing).';
I will explain why :
in SqlPassDatabase.inc
procedure TSqlitePassDatabaseDataTypeOptions.LoadFromDatabase(_LoadOptions: TsqlitePassDataTypeStorageOptions = []);
...
{ Storage Version }
FStorageVersion := StorageInfoStrings[1]; // THIS PRODUCES EXCEPTION EVERY TIME!!!!
....
....
except
if MessageDlg(Msg1044, mtWarning, [mbYes, mbNo], 0) = mrYes
then FDatabase.Engine.Exec('Drop table "SqlitePass__DbSettings";'); //AND HERE IS CAUGHT (HANDLED)
end; {Try 2 }
So we get every time this annoying message although we already saved new "SqlitePass__DbSettings" in database,
plus further code after "exception producer" obviously has not been executed (nevertheless is critical or not).