C
Corey-g via AccessMonster.com
Hi,
I am trying to create a single connection procedure that will be re-used for
every SQL call.
Does it matter if I use ADO? Do I need to link / relink tables, or can this
all be done with out linking, and using passthrough queries? How do I go
about updating records in the back end if something changes?
Am i setting myself up for a ton of extra work this way?
What I have so far is a code module (basGlobal), and I have declared cn & rs
as public ADODB objects (connection & recordset) and strSQL, strUID, & strPWD
as strings just after "Option Explicit"
I then have a public function OracleConnect that takes 2 params (UID & PWD)
and returns a ADODB.Connection -- Should I be returning anything?
The first thing I am doing is testing the connection state "If IsNull(cn.
state) then" does this make sense?
If it is null, I set "cn" to a new connection, set the properties, and open.
What would be an apropriate else?
Should I have a single function to handle all queries as well, and how would
I do that? Have the query function call the connection function, the use the
returned connection? Or as I have it at the module level, can I just use
"cn" (I would code these into the same module)? Should all of my calls go to
the query function, and have that open & close the connection each time?
TIA,
Corey
I am trying to create a single connection procedure that will be re-used for
every SQL call.
Does it matter if I use ADO? Do I need to link / relink tables, or can this
all be done with out linking, and using passthrough queries? How do I go
about updating records in the back end if something changes?
Am i setting myself up for a ton of extra work this way?
What I have so far is a code module (basGlobal), and I have declared cn & rs
as public ADODB objects (connection & recordset) and strSQL, strUID, & strPWD
as strings just after "Option Explicit"
I then have a public function OracleConnect that takes 2 params (UID & PWD)
and returns a ADODB.Connection -- Should I be returning anything?
The first thing I am doing is testing the connection state "If IsNull(cn.
state) then" does this make sense?
If it is null, I set "cn" to a new connection, set the properties, and open.
What would be an apropriate else?
Should I have a single function to handle all queries as well, and how would
I do that? Have the query function call the connection function, the use the
returned connection? Or as I have it at the module level, can I just use
"cn" (I would code these into the same module)? Should all of my calls go to
the query function, and have that open & close the connection each time?
TIA,
Corey