Firebird: How to get updated a updated files list after a drop table commit lazarus / 16-Databases ---------------------------------------------------------------------- MoellerCLaus · 2014-12-26 19:25 On a form of mine I need to let the users have to possiblity to "drop"/erase a table. The table is dropped - gone. But the read to ZConnection1.GetTableNames('',Tabeller) does not seem to be updated/actual. Clearly I missed something! The connection is on autocommit. Any hints highly appreciated. Code: [Select]procedure TDatabaseSeeForm.DeleteTableExecute(Sender: TObject); begin   If MessageDlg('Slet tabel ' + StringGrid1.Cells[0,StringGrid1.Row] + '?',     mtConfirmation,[mbYes,mbNo],0) <> MrYes Then Exit;   With ZQuery1.SQL do     Begin       Clear;       Add('Drop table ' + StringGrid1.Cells[0,StringGrid1.Row]);     End;   Try     ZQuery1.ExecSQL;   Except     on E: EDatabaseError do       begin         MessageDlg('Error', 'A database error has occurred. Technical error message: ' +             E.Message, mtError, [mbOK], 0);       end;   end;   IndlaesDatabasen; end; procedure TDatabaseSeeForm.IndlaesDatabasen; Var A : Integer; begin   // Check if tables are there   Tabeller := TStringList.Create;   MainForm.ZConnection1.GetTableNames('',Tabeller);   A := 0;   StringGrid1.RowCount := 1;   While A < Tabeller.Count Do     Begin       If Pos('$',Tabeller.Strings[A]) = 0 Then         Begin           StringGrid1.RowCount := StringGrid1.RowCount + 1;           StringGrid1.Cells[0,StringGrid1.RowCount-1] := Tabeller.Strings[A];         end;       Inc(A);     end; end; ---------------------------------------------------------------------- patyi · 2014-12-26 20:50 For this task I use separate - secondary - connection component, because have to close and reopen the connection to be refresh the table list calling with GetTableNames() function. ---------------------------------------------------------------------- MoellerCLaus · 2014-12-27 07:35 Thanks - this might be a way through. I had hoped for a "refresh" procedure or function. ---------------------------------------------------------------------- EgonHugeist · 2014-12-27 15:57 @MoellerCLaus Note: Zeos-internals are caching such informations. Which means Result of GetTableNames is allways same as long you're connected. You can flush the whole cache by using TZConnection.DbcConnection.GetMetadata.ClearCache; There is a feature request to get the caches flushed by object and/or purpose: http://sourceforge.net/p/zeoslib/tickets/104/ Or just follow suggestion of Patyi. Michael