I have some code that was using an ADODB.Recordset
object to query a MariaDb database. In my query I am using coalesce
such as this -
SELECT COALESCE(offers_owner.description, offers.description) AS description FROM
offers_owner LEFT JOIN websites on offers_owner.website_id = websites.id LEFT JOIN offers on
offers_owner.offer_id = offers.id WHERE offers_owner.id = 401
and in my code I have this -
If Not IsNull(rs("description")) or rs("description") <> "" Then
response.write "<p class=" & chr(34) & "clear" & chr(34) & "><br />" & replace(replace(rs("description"),"company_name",session("company")),"company_city",session("city2")) & "<br /><br /></p>" & vbcrlf
end if
This works fine, and outputs as need be.
But, as soon as I switch to using an ADODB.Command
object, I get an "invalid use of null". If I remove the conditional If Then
, it does not throw and error.
Any idea as to why?
Thank you.
I tried to limit the conditionals in the IF Then statement