How can this be NIL?

		debug SQL
		rs=DB.SQLSelect(SQL)
		debug str(db.error)
		If DB.Error Then
				DB_Error(False,SQL)
				Return False
		Else
				debug str(rs.RecordCount) <------ NIL ON THIS LINE
				Return True
		End If

but only on large results…
No errors on the database, the SQL is legit , but rs is nil
If I do the exact same thing with a smaller table… it works no problem

Put a breakpoint in before rs.RecordCount is evaluated and see what the debugger has to say?

is says it is NIL

database is fine
SQLSelect did NOT return an error
RS is nil

If I copy the SQL into a 3rd party app… it works

maybe you get nil in case of an out of memory error.

Normally the db plugin should report that as an error.

Thats my point… no part of the process produces an error… trapped or not… just silently returns NIL

Ideally it would raise an exception.

What happens if you check rs for Nil without using rs.RecordCount?
e.g:

debug SQL
rs=DB.SQLSelect(SQL)
debug str(db.error)
If DB.Error Then
    DB_Error(False,SQL)
    Return False
ElseIf rs=Nil Then
    MsgBox "OK, it really is Nil"
    Return False
Else
    debug str(rs.RecordCount) <------ NIL ON THIS LINE
    Return True
End If

I don’t know which plugin you’re using but some databases do not natively return a RecordCount and I’m curious to know if the problem lies in a plugin method that’s trying to iterate over a large RecordSet to count up a number for you.

This is SQLite (not a 3rd party plugin)
The Debugger says RS is nil if I put a break before that Debug statement
DB.ERROR is FALSE (verified by the debugger)
Error number is ZERO
Error Message is “is not an error”

and the expected answer is 1000000

I may be wrong: I always check rs against Nil (Nil means no Record in rs ?), then if there is a DB.Error.

The point here is … an SQL statement that is executed without an error should at worst return an EMPTY recordset (it would have a structure) but it would not be NIL

and check of no check… it is unexpected results… I can’t tell the user “Hey, Nice Query…but I don’t feel like answering you”
where I wouldn’t have a problem with “HEY! you query is malformed, try again”

How long does it take in the 3rd party app compared to your software? If you’re arriving at debug str(rs.RecordCount) faster then the 3rd party gets a response maybe it’s some sort of time out issue?

my app takes 108 seconds before it bombs… the time to do the SQLSelect

cannot compare to other apps, as I know they have some super top secrect paging method which I what I am trying to duplicate…

Report a bug to Xojo.
Could be an error they don’t forward.