Ok, attached is a sample project that demonstrates the issue I am having.
if you don't sort between query opens it works fine, only after a sort is performed does it raise the error.
I also have it showing a message box that all indexes are cleared.
NOTE: I could be doing something wrong here and that is why I asked before posting a bug report.
You will need to provide your own copy of SQLite3.dll on windows as I could not attach the zip with the dll present as it made it to big.
The sample sqlite database is in the zip and is called dds.db.
Open the example db
open query1
sort on last_name or first_name by clicking the column header, you will see sort arrows.
attempt to open query2, it will raise a error that the last field you sorted cannot be found, which it can't because it's a new
result set.
Before the queries are opened I clear the indexdefs and I also clear the indexname property. I know I could work around this by simply creating a new tsqlquery each time, but you should not have to do that.