Forum Moderators: open
basically, I am looking for a "does this object exist" type of function.
It is looking like there is no way to do this....
isempty, isnull, isobject... none of these functions will work for me - they won't tell me if the object has been created or not.
I know this is not an ASP forum, but I thought I would ask anyway. Maybe someone will know
thank you for the tip. that was exactly what I was looking for, and it worked perfectly.
Either vartype or typename - both will tell me if an object was created or not.
after that, I can close the recordset, and then set it to nothing, and then at the very end, close the database connection and set it to nothing.
in case anyone else has this same problem, here is some code, for a generic object called, um, object...
'''''''''''''''''''''''''''''''''''''''''''''''
if typename(object) = "Empty" then
response.write ("<br>typename was " & typename(object) & ".")
elseif typename(object) = "Recordset" then
response.write ("<br>typename was " & typename(object) & ".")
object.Close
set object= nothing
end if
'''''''''''''''''''''''''''''''''''''''''''''''
this checks the object, if it exists (if it has been instantiated) it is closed and then set to nothing.
After doing that for all the objects, then the db connection can be closed, and then set to nothing.