Hi,
sPathFile := TPath.Combine(IncludeTrailingPathDelimiter(TPath.GetDocumentsPath), 'sqlite3.DB');
Flag := TFile.Exists(sPathFile);
if Flag then
begin
DBConn.SpecificOptions.Values['ForceCreateDatabase'] := 'False';
end
else
begin
DBConn.SpecificOptions.Values['ForceCreateDatabase'] := 'True';
DBConn.SpecificOptions.Values['Direct'] := 'True';
DBConn.SpecificOptions.Values['EncryptionAlgorithm'] := 'leBlowfish';
DBConn.SpecificOptions.Values['EncryptionKey'] := '11111';
end;
DBConn.Database := sPathFile;
DBConn.Open; // An error occurred.
Error Message: database disk image is malformed.
How to fix?
Delphi XE7 Firemonkey
UniDac 6.1.3
Sqlite 3
database disk image is malformed
Re: database disk image is malformed
Solved.
sPathFile := TPath.Combine(IncludeTrailingPathDelimiter(TPath.GetDocumentsPath), 'sqlite3.DB');
Flag := TFile.Exists(sPathFile);
if Flag then
DBConn.SpecificOptions.Values['ForceCreateDatabase'] := 'False'
else
DBConn.SpecificOptions.Values['ForceCreateDatabase'] := 'True';
DBConn.SpecificOptions.Values['Direct'] := 'True';
DBConn.SpecificOptions.Values['EncryptionAlgorithm'] := 'leBlowfish';
DBConn.SpecificOptions.Values['EncryptionKey'] := '11111';
DBConn.Database := sPathFile;
DBConn.Open; // No error
sPathFile := TPath.Combine(IncludeTrailingPathDelimiter(TPath.GetDocumentsPath), 'sqlite3.DB');
Flag := TFile.Exists(sPathFile);
if Flag then
DBConn.SpecificOptions.Values['ForceCreateDatabase'] := 'False'
else
DBConn.SpecificOptions.Values['ForceCreateDatabase'] := 'True';
DBConn.SpecificOptions.Values['Direct'] := 'True';
DBConn.SpecificOptions.Values['EncryptionAlgorithm'] := 'leBlowfish';
DBConn.SpecificOptions.Values['EncryptionKey'] := '11111';
DBConn.Database := sPathFile;
DBConn.Open; // No error
Re: database disk image is malformed
Hello,
Glad to see that you solved the problem. If you have any other questions, feel free to contact us.
Glad to see that you solved the problem. If you have any other questions, feel free to contact us.