Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you really destroy an object?

Status
Not open for further replies.

VBGuy2112

Programmer
Feb 19, 2002
58
US
This is part curiousity and part "need to know for my web page programming style". How do you really destroy an object so that you could dimension it again?

For example:

Dim objConn ' Database connection

objConn.Open .......
objConn.Close

Set objConn=Nothing


Dim objConn

blah blah blah


The reason why I want to dimension the variable again is because I use include files to do a lot of things and I would like for them to dimension their own objects and then destroy them (like functions in visual basic). I don't want to have to think of different object names for every file.

Is there a way to do this? Setting it equal to nothing doesn't seem to destroy it to the point that I could redim it.

Thanks!
 
you cant dim something twice in the same function or method, you can only do it once, once dimmed you can set it to what you want (nothing, object, string whatever).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top