- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
ExitFunction:
If Not objConn Is Nothing Then Set objConn = Nothing
If Not objCmd Is Nothing Then Set objCmd = Nothing
Exit Function
HandleError: Dim eNbr$, eSrc$, eDsc$
eNbr = Err.Number
eSrc = Err.Source
eDsc = Err.Description
Err.Raise vbObjectError + eNbr, eSrc, eDsc & " " & strSQL
Resume ExitFunction
End Function
<FONT color=#000000>So, he throws an error, bubbles out to the calling function, and then closes the objects... hem.. ;)</FONT>
<FONT color=#000000>In vb you should ALWAYS set object references to nothing and not let them drop out of scope, there are a number of objects in vb that will be left hanging till the VBIDE is closed if not set to nothing, this doesn't occur when the application is compiled, but can be a real bugger to debug if the compiled app doesn't work as intended, because a reference was decremented ealier than the same call in the VBIDE. </FONT>
Dj
<FONT color=#000000></FONT>
Admin
They have to start somewhere!..... :)))))))))))
I sometimes say... (In business:) "Who does not know, pays! If not does it with the body..."
If don't know how to do something, you pay to someone to do it for you... if you try to do it.. you shall pay with the body...
Oh well... isn't properly translated... but that's the idea...
Admin
You can't say it isn't carefull the SaveApplication false return value, is properly defined even before the variables declaration...
:)