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
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”
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?