If the SQL query errors, the default error function "fnOnError" ends the request (called from line 59). After the request is ended, any writes to the request cause an error - for example, line 62.
One fix would be to test for an error in the if statement on line 61.
If the SQL query errors, the default error function "fnOnError" ends the request (called from line 59). After the request is ended, any writes to the request cause an error - for example, line 62.
One fix would be to test for an error in the if statement on line 61.