sqlite query xojoweb returns nilobjectexception

Hi everyone!

I dont know what am i doing wrong here, been stuck for a while, some help would be very appreciated.
I keep getting a NilObjectException in the following code:

[code]Dim rs As RecordSet
Dim sql As String

sql = “SELECT MAX(alst_foli) FROM ecoalst”
rs = Session.BBDDsqlite.SQLSelect(sql) //this is where i get the NilObjectException
it seems the session or the database are the nil object because before getting the result of the query the exception comes out.

thank you !

i am executing the code in the MAILSENT event from a MAILSOCKET, then i ran the same code in a button an it works fine, what is happening?

I would guess that at this point, since the socket is operating asynchronously, Session is nil. You may need to acquire the session context again.