Results 1 to 5 of 5

Thread: declaring ado connection

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    usa
    Posts
    9
    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.

  2. #2
    Guest
    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.

  3. #3
    Hyperactive Member compuGEEK's Avatar
    Join Date
    May 1999
    Location
    Mpls,MN,USA
    Posts
    281
    Here is an example:

    Code:
    <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>

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    usa
    Posts
    9

    when should I use global .asa

    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?


  5. #5
    Guest
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width