You are not logged in.
Pages: 1
var
   db: TSQLDBConnectionProperties;
   rows: ISQLDBRows;
begin
db := TSQLDBSQLite3ConnectionProperties.Create( 'Base.sql', '', '', '');
  rows := db.ExecuteInlined('SELECT * FROM info', true);
 if rows<>nil then
    begin
      while rows.Step do
        begin
         Writeln( rows.ColumnString('url') );
        end;
    end;
 TFile.Delete( 'Base.sql' ); // error
end;When I try to delete the "Base.sql", I get the error :


How unlock base ?
db.Free;Does not help
Last edited by racosa (2021-08-01 12:20:46)
Offline
Please read the documentation about mixing ISQLDBRows and connection in the same function.
https://synopse.info/files/html/Synopse … l#TITL_195
The ISQLDBRows instance is not released before the db.Free is called, so the DB file is still open due to the connection.
Offline
Pages: 1