Hello,
I am building a VB6 application (replacing an Access 97 app) that connects to a SQL 7 DB via ODBC using ADO connection and recordset objects.
At present, I am declaring connection and recordset objects at the procedure level. My SaveRecord sub declares, initializes, opens, closes, and destroys its own connection and recordset objects. My most complex form loads and saves data to seven related data tables, so this is a lot of recordsets to open.
I am considering moving these objects to the module level or even the global level. Is there any reason I would not want to do this? I’m not worried about runtime errors because I intend to write “Does objCN exist?” and “Is objCN open?” code to test for the presence and status of these objects before using them.
My main uncertainties relate to performance. Does making ADODB objects global vars hurt performance?
Any comments or suggestions of resources are appreciated.
-Brian
_________________________________
Brian Begy
Developer
Chicago Data Solutions
tel: 773 350 8389
fax: 773 262 5163
email: brian@chicagodatasolutions.com
_________________________________
I am building a VB6 application (replacing an Access 97 app) that connects to a SQL 7 DB via ODBC using ADO connection and recordset objects.
At present, I am declaring connection and recordset objects at the procedure level. My SaveRecord sub declares, initializes, opens, closes, and destroys its own connection and recordset objects. My most complex form loads and saves data to seven related data tables, so this is a lot of recordsets to open.
I am considering moving these objects to the module level or even the global level. Is there any reason I would not want to do this? I’m not worried about runtime errors because I intend to write “Does objCN exist?” and “Is objCN open?” code to test for the presence and status of these objects before using them.
My main uncertainties relate to performance. Does making ADODB objects global vars hurt performance?
Any comments or suggestions of resources are appreciated.
-Brian
_________________________________
Brian Begy
Developer
Chicago Data Solutions
tel: 773 350 8389
fax: 773 262 5163
email: brian@chicagodatasolutions.com
_________________________________