@Norman P In theory that _should_ make the existing ones reference count go to 0 and so it should get destroyed
I've guessed so.
But the difference is:
rsExisting = DB.SQLSelect "new query" will cause the DB object to fetch a new RecordSet while the
rsExisting still is in Scope and not yet
That certainly would account for the difference compared to:
rsExisting = nil
rsExisting = DB.SQLSelect("new query")
So I keep my my opinion described in this answer .
The current behavior is not quite friendly when it comes to use different DB Servers/Systems with Xojo, since their Plugin is behaving unexpected (even though it can be explained). Existing code working perfectly fine on other DB Systems won't "just work" with Xojo's MSSQLServerPlugin. Well, kind of works - but giving unexpected behavior ;)
Still: I really appreciate what you've figured out. That will be very useful in some situations.