oliveiro wrote:MS Access (the product that I want to replace by Base) would immediately show me that information.
...I know of course of "select count(*) from tablex" ... my question relates to the standard table view when opening a table in Base.
SELECT COUNT(*) FROM CONTACTSI just ran
Count(*) in Base on an "embedded database" table with 25,000 records (4MB file; all records filled with
bogus contact information). The result "25000" was instantaneous.
But "instantaneous" is subjective, so I ran the same command on the same table in 'server mode' (HSQLDB 1.8) using
SQL Workbench/J. The reported time was 0.02 seconds to return the "25000" result. I then quadrupled the records to 100K and the "100000" count was reported in 0.07 seconds.
These times are relative to my laptop with
mid-range mobile CPU, which is quite similar to an average dual-core desktop sold over the past 6 years or so.
So I'm guessing that Microsoft's developers considered a few hundredths of a second to be worth the wait, while Base developers were simply aghast!
All kidding aside, it probably came down to a philosophy on reporting the number of records loaded in memory, versus the total number of records in the table. I'm with you...I think it's a design flaw in Base. But we all share the guilt of not reporting these things to the devs.
oliveiro wrote:Any way this can be configured or otherwise achieved?
So we may have to convince the devs that we really want a record count in Table view, but there is a clunky workaround for Base
Forms which can host Table Control Grids similar to the standard Table view:
- Code: Select all Expand viewCollapse view
Sub InitializeForm 'Form > Event > When Loading
Dim oForm As Object
oForm = ThisComponent.DrawPage.Forms.GetByIndex(0) '.GetByName("<form name here>") may be easier to troubleshoot
IF oForm.isloaded = false THEN Wait 100 'allows faster CPUs to continue while waiting for slower ones
oForm.Last
oForm.First 'this along with .Last above leaves the total number of records in nav bar
' oForm.MoveToInsertRow
End Sub