Is it necessary to declare a connection object every-time in every module which tries to access a recordset from the the same .mdb file the module is in? e.g.
dim cnn as connection
Dim rst as ADODB.Recordset
set cnn = New ADODB.Connection
Set cnn = CurrentProject.Connection
rst.Open "tblMyTable", cnn
'other code
Should it not be simple if u r accessing the same .mdb then the module should assume the active connection to the current db. why do we have to declare this in every module?
If anyone can throw some light on this, i would be grateful.
dim cnn as connection
Dim rst as ADODB.Recordset
set cnn = New ADODB.Connection
Set cnn = CurrentProject.Connection
rst.Open "tblMyTable", cnn
'other code
Should it not be simple if u r accessing the same .mdb then the module should assume the active connection to the current db. why do we have to declare this in every module?
If anyone can throw some light on this, i would be grateful.