PDA

Click to See Complete Forum and Search --> : declaring ado connection


luisvb
Aug 6th, 2000, 07:54 AM
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.

Clunietp
Aug 6th, 2000, 02:18 PM
You want to put a connection OBJECT in a session variable? Or do just want to put the connection STRING in a session var?

luisvb
Aug 6th, 2000, 03:52 PM
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]

Clunietp
Aug 7th, 2000, 11:06 AM
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)