Results 1 to 4 of 4

Thread: declaring ado connection

  1. #1

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

    Thumbs down

    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
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    You want to put a connection OBJECT in a session variable? Or do just want to put the connection STRING in a session var?

  3. #3

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

    I just want ....

    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]

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    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)

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