I would like to know how can I declare an ADO connection on an global .asa. Do I have to use the <object> tag if so where it goes under sesion_onstart or applicattion_onstart or outsite these two preocedure?. please show me an example.
Printable View
I would like to know how can I declare an ADO connection on an global .asa. Do I have to use the <object> tag if so where it goes under sesion_onstart or applicattion_onstart or outsite these two preocedure?. please show me an example.
You want to put a connection OBJECT in a session variable? Or do just want to put the connection STRING in a session var?
I just want to create the connection object like:
set objconnection = server.createobject"adodb.connection").
Note= what I really want is to create the connection object just once on an global .asa file and be able to access it from any pages in my web application instead of creating a connection each time I need a recorset..
[Edited by luisvb on 08-06-2000 at 04:54 PM]
Avoid putting ANY objects into SESSION or APPLICATION variables, as they kill your performance.
The "proper" way to do this is to open a connection on EVERY PAGE that needs to get data. IIS uses connection pooling for your DB, so access should be very fast, and its only 1 extra line of code per page (its worth it)