Multiple opening and closing of ADO connections

Results 1 to 2 of 2

Thread: Multiple opening and closing of ADO connections

  1. #1
    Join Date
    Dec 1969
    Posts
    1,671

    Default Multiple opening and closing of ADO connections

    I have a web application which has, on average, 3 listboxes on each of 4 asp pages that allows a user to make choices in inter-related categories which are then used to bring back data from a database. On any one page, the choice made in the first listbox limits the values shownn in the second listbox which in turn limits the choices in the third listbox.... This is a design criteria put forth by my "customer" <BR>For each list box, I am:<BR>1)Building a SQL string<BR>2)opening a connection and filling a recordset <BR>3)populating the listbox<BR>4)closing the connection and recordset.<BR>There is only one subroutine used to do this via an include file but is all that opening and closing eating up time ?<BR>Is there a way to keep the connection open and open and close just recordsets until the user is finished and then close the connection (or is that a stupid idea !) ? Does connection pooling sort all this out for me ?<BR>Thanks for any help.

  2. #2
    Join Date
    Dec 1969
    Posts
    552

    Default RE: Multiple opening and closing of ADO connections

    I would open up just one connection, and do the multiple recordsets on it, rather than opening a new connection for each recordset. From what I understand, establishing a connection with a database is a performance hit, so why do it more often than you need to? You might also want to check out the ADO 2.0 GetString method to speed up your select box creation.

Posting Permissions

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