D
djc
I have several subroutines (all inline code) that wind up using the same
database connection object variable. I have been declaring a new variable in
every sub. I just now came to a point where I want to call one sub that will
utilize a database connection from within another sub that is already
utilizing a database connection.
1) Can I just declare this database connection once outside of all
subroutines to make it global (the way I understand you make a var of global
scope) and use it for all my different command objects within the different
subs? And just call the Open and Close methods on it from within the
different subs?
I know that is how to make a global variable and have done it with other
things like simple strings and numbers but I am not sure if a database
connection object variable would have different requirements?
any input is appreciated. Thanks.
database connection object variable. I have been declaring a new variable in
every sub. I just now came to a point where I want to call one sub that will
utilize a database connection from within another sub that is already
utilizing a database connection.
1) Can I just declare this database connection once outside of all
subroutines to make it global (the way I understand you make a var of global
scope) and use it for all my different command objects within the different
subs? And just call the Open and Close methods on it from within the
different subs?
I know that is how to make a global variable and have done it with other
things like simple strings and numbers but I am not sure if a database
connection object variable would have different requirements?
any input is appreciated. Thanks.