[SOLVED] RecordCount not working - SQLite3 lazarus / 16-Databases ---------------------------------------------------------------------- 1HuntnMan · 2025-06-20 12:53 Could anyone tell me why this isn't work for reporting the total number of clients in the Clients table in a SQLite3 Database? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TFrmClientsMain.QryClientsAfterPost(DataSet: TDataSet);begin  EditTTLClients.ReadOnly:= False;  IntRecCount:= DSrcClients.DataSet.RecordCount;  EditTTLClients.Text:= IntToStr(IntRecCount); //-> Record total Clients...  EditTTLClients.ReadOnly:= True;  BitBtnSave.Enabled:= False;  BitBtnCancel.Enabled:= False;end; ---------------------------------------------------------------------- n7800 · 2025-06-20 13:02 Perhaps this link will help you. ---------------------------------------------------------------------- Thaddy · 2025-06-20 14:07 RecordCount is not really a concept that fits well with sql databases, but you can query the database:Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i SELECT COUNT(*) FROM your_table_name; ---------------------------------------------------------------------- CharlyTango · 2025-06-20 19:43 If only a few data records are affected, RecordCount() after a Last() will suffice. If you want to be sure (and for larger amounts of counted records), then ask the SQL server as @Thaddy suggested. A TDataset is not a DBF table ---------------------------------------------------------------------- Thaddy · 2025-06-21 05:03 In this case the server can also mean Sqlite3, of course. ---------------------------------------------------------------------- 1HuntnMan · 2025-06-21 17:57 Okay, thanks all. That's from my ole TDbf thinking. What's the different between a Duck?      ... One of it's legs are both the same! ---------------------------------------------------------------------- 1HuntnMan · 2025-06-22 15:10 Just feedback what I did: 1. Created a private procedure: UpdateTTLClients   Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     procedure UpdateTTLClients;    begin       if QryTTLClients.Active then QryTTLClient.Close;       QryTTLClients.SQL.Text:= 'SELECT COUNT(*) AS TTL FROM CLIENTS;       QryTTLClients.Open;       EditTTLCntks.ReadOnly:= False;       EditTTLCntks.Text:= QryTTLClients.FieldByName('TTL').AsString;       EditTTLCntks.ReadOnly:= True;    end;  2. Added an extra Query component just for running the query separate from the main QryClients and called it QryTTLClients 3. Of course, need to add in your Form Create: QryTTLClients.Database:= ConnectClients; and QryTTLClients.Transaction:= TransClients 4. Then in your QryClientsAfterDelete and AfterPost just run UpdateTTLClients. It works ...