-
Can this cause me a problem
This class declares
dim dbConnect as clsDatabaseAccess
set dbConnect = new clsDatabaseAccess
dbConnect.connect
dbConnect.execSQL
ProcessFile(dbConnect)
dbConnect.execSQL
dbConnect.disconnect
set dbConnect= Nothing
Public Function ProcessFile(ByRef objDB As clsDatabaseAccess)
objDB.execSQL
end sub
I don't know if this will cause a memory leak or not. I don't know what happens to the object passes as reference(objDB)
-
The only problem I see is that you are executing 3 times.
But, passing the object byref to a function won't cause a problem. Since it is byref, you don't have to close it in the function being called, just in the calling procedure.