M
Max Moor
Hi All,
When declaring a recordset, I declare the variable at the top of the
function, then, just before it's first use, I instanciate it:
Set rst = New ADODB.Recordset
I want to do the same thing with an ADODB.Connection. What I have in
code now, is a declaration at the top:
Dim ADOCon As New ADODB.Connection
Then before it's first use...
Set ADOCon = CurrentProject.Connection
This instanciates at declaration, though. I think I want to change this
to is...
Dim ADOCon As ADODB.Connection
...
...
...
Set ADOCon = New ADODB.Connection
Set ADOCon = CurrentProject.Connection
First off, does this look correct? Secondly, is there a way to combine
these staements into one? I'm not thinking that would buy me much. I'm
just curious.
- Max
When declaring a recordset, I declare the variable at the top of the
function, then, just before it's first use, I instanciate it:
Set rst = New ADODB.Recordset
I want to do the same thing with an ADODB.Connection. What I have in
code now, is a declaration at the top:
Dim ADOCon As New ADODB.Connection
Then before it's first use...
Set ADOCon = CurrentProject.Connection
This instanciates at declaration, though. I think I want to change this
to is...
Dim ADOCon As ADODB.Connection
...
...
...
Set ADOCon = New ADODB.Connection
Set ADOCon = CurrentProject.Connection
First off, does this look correct? Secondly, is there a way to combine
these staements into one? I'm not thinking that would buy me much. I'm
just curious.
- Max