To determine whether an object is released we apply: TypeName (conn) = "Nothing" (must use nothing can not use anything, lowercase results are not true, is the ASP also case-sensitive?)
The following are the referenced contents:
<%
Dim Conn ' statement
Set conn = Server.CreateObject ("ADODB. Connection ")" Create
' Use
Set conn = Nothing ' free
%> |
Station. Long Station
We usually create an object in the form of, and use and release it, the question is how do we determine if an object has been released? Can I use IsObject? Let's try the following:
The following are the referenced contents:
<%
Dim Conn
Response.Write (IsObject (conn)) ' result is false
Set conn = Server.CreateObject ("ADODB. Connection ")
Response.Write (IsObject (conn)) ' result is true
Set conn = Nothing
Response.Write (IsObject (conn)) ' result is true
%> |
Visible and can not use IsObject to determine whether an object has been released, then we use the VarType or TypeName function to try:
The following are the referenced contents:
<%
Dim Conn
Response.Write (TypeName (conn)) ' Results empty
Set conn = Server.CreateObject ("ADODB. Connection ")
Response.Write (TypeName (conn)) ' Results connection
Set conn = Nothing
Response.Write (TypeName (conn)) ' Results nothing
%> |
chinaz@com
So, to judge whether an object is released we apply:typeName (conn) = "Nothing"(must use nothing can not have nothing, lowercase result is not true, is the ASP also case-sensitive?)