PDA

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


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

Aug 7th, 2000, 04:21 AM
Dunno, but I do know that a lot of web hosting companies wouldn't appreove of doint this because it causes the connection to remain open permanently...bogging down the server.

Instead I tend to setup my connections (which will be used regularly on several pages) in a seperate page and use SSI to include this page in all the pages that need the connection.

compuGEEK
Aug 7th, 2000, 10:26 AM
Here is an example:


<SCRIPT RUNAT = Server LANGUAGE = VBSCRIPT>

Sub Application_OnStart

Application("MyConnectionString") =
"DSN=FoodMart;User Id = sa;Password =;Description=FoodMart;
Server =MyServer;App=MyApp'sEnvironment;WSID =MyMachine;"

End Sub
</SCRIPT>

luisvb
Aug 8th, 2000, 09:47 AM
Thanks for the advise matthew.

So does My application will be slow when creating objects in global .asa?

what about variables in globlal .asa,
does varibles will slow my pages also?

So in which case should I use global .asa?

Aug 9th, 2000, 05:59 AM
I don't know if it will be particularly slow on a low loaded server...it's the sites that host lots of people's asp website that discourage it because if they all do this then there will be loads of ADO connections open at the same time for ages and that could bog down a server.