Another? Database is Locked
Posted: Fri 10 May 2013 07:41
Hello,
i have the following piece of code:
I get information from LDAP and extra information i need for the user i write in an SQLite database. When another user uses the program with the same database, i sometimes get the message "Database is Locked" when i try to do something. I think it has to do with the above code, but i can not test it, since i have no rights to install Delphi om the computer i am testing on. I can only program on one computer and run it on another.
The code above is what i am used to doing with MSAccess, i found some differences with SQLite, but i do not know what to do in the above.
Do i need to put an Unlock or a Commit after the Post? or should the above be enough.
i have the following piece of code:
Code: Select all
try
qry := dmAeres.qryUsers;
if not qry.Active then
qry.Active := True;
if not qry.Locate(UA_USERNAME, Username, [loCaseInsensitive]) then begin
qry.Append;
qry.FieldByName(UA_USERNAME).AsString := UserName;
qry.Post;
end;
except
on E: Exception do begin
SKAMessageOk(E.Message);
end;
end;
The code above is what i am used to doing with MSAccess, i found some differences with SQLite, but i do not know what to do in the above.
Do i need to put an Unlock or a Commit after the Post? or should the above be enough.