Guru's
I'm using late binding to connect to an access database.
I'm address this database in several routines and modules.
However I don't want to initiate the connection and close it each time I change between subroutines.
Instead I'd like to create the late bind once.
and access it whenever needed.
Any Thoughts?
John,
In Annapolis.
I'm using late binding to connect to an access database.
I'm address this database in several routines and modules.
However I don't want to initiate the connection and close it each time I change between subroutines.
Instead I'd like to create the late bind once.
and access it whenever needed.
Code:
Dim objAccess As Object
Dim sFullPath as string 'Path and Name of database
'Establish Late Bind
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase sFullPath
With objAccess
'Do stuff with objAccess
End With
'Close Late Binding
objAccess.CloseCurrentDatabase
objAccess.Quit
Set objAccess = Nothing
John,
In Annapolis.