things are far better since I used db = Nil. Now, I can click many different times (successive) to Sort by Columns (0 and 1)… The Sort is done by SQLite.
Prior to that, the sort is done, but leads to error messages (RS is Nil or so…).
There may be a max number of open db… (where db.Closed do not decrease it)…
NB: I checked very carefully all code in the window: each and every db instance is correctly Closed.
But when I implemented the SortColumn Event Code, I had to Nil the db in the SortColumn Event Code where I init and use it.
And I do not checked - yet - the project on Windows 10.
Some database engines won’t execute a Close if there are still transactions that haven’t been either committed or rolled-back. Perhaps you still had an unresolved transaction somewhere.