hi, all
I am working on a program which works fine on windows10 and ubuntu22 x86_64. There is something like this:
var
dbConn: TSQLite3Connection;
trans: TSQLTransaction;
query: TSQLQuery;
...
function connectToDB: boolean;
begin
Result := False;
dbConn := TSQLite3Connection.Create(nil);
query := TSQLQuery.Create(nil);
trans := TSQLTransaction.Create(nil);
dbConn.DatabaseName := 'hy.db';
dbConn.LoginPrompt := False;
dbConn.Transaction := trans;
query.Transaction := trans;
try
trans.StartTransaction; // <-----this line
except
query.Free;
trans.Free;
dbConn.Free;
exit;
end;
trans.Active := False;
updateSysItems;
Result := True;
end;
I do this to check if the sqlite database can be accessed when program is starting up. And it always works.
Then I put this program on ubuntu18 armV7l, on which the program will really run in the future. First I built the program by fpc prj.pp, it looked ok and I got the executable file. But everytime when it goes to the line "trans.StartTransaction" I get an error message like:
An unhandled exception occurred at $00000000:
EAccessViolation: Access violation
$00000000
$0002EB60
The file hy.db is there and I can read the data by command "sqlite3 hy.db" via ssh terminal.
I didn't install lazarus but only FPC3.2.2 on ubuntu armV7l since it does not have a GUI. And I think since TSQLite3Connection is a component of fpc it should be ok.
What's wrong?