emblewembl
Programmer
I have a question about closing recordsets, connections etc. An old colleague of mine wrote a sub routine which is used to 'kill' any object. The sub is as follows:
So to kill a connection that is called objConn, for example, you would put in your page:
Can you all tell me if this code is ok - I want to reuse in a new project if it is. Also I know you should always close a recordset or a connection, but what about if you create an instance of the MSWC.Contentrotator? Should this be 'killed' too? And what about the MSWC.BrowserType object?
Hope you can enlighten me! i love chocolate
Code:
Sub KillObject(ByRef objToKill)
On Error Resume Next
objToKill.Close
Set objToKill = Nothing
Err.Clear
End Sub
Code:
Call KillObject(objConn)
Can you all tell me if this code is ok - I want to reuse in a new project if it is. Also I know you should always close a recordset or a connection, but what about if you create an instance of the MSWC.Contentrotator? Should this be 'killed' too? And what about the MSWC.BrowserType object?
Hope you can enlighten me! i love chocolate