confusion on db connection

Results 1 to 2 of 2

Thread: confusion on db connection

  1. #1
    Renee G. Guest

    Default confusion on db connection

    In the class I am taking we use the following for a database connection:<BR><BR> application("...")<BR><BR>but I noticed in a web tutorial they use just:<BR><BR>"...")<BR><BR>Is the example from my class just pointing to the connection string located in global.asa, or is this an application or session level (which is a no-no?). My instructor admits he knows it&#039s not recommended to keep the database open through the session but he also doesn&#039t know the alternatives.<BR><BR>I&#039m going batty trying to understand the differences!

  2. #2
    Adam Werner Guest

    Default RE: confusion on db connection

    Wow, there&#039s a lot here so I&#039ll get right to it.<BR><BR>In your first example [ application("...")], it appears to me that you are using an application level variable to contain your connection string.<BR><BR>The second example ["...")], appears to be a straight reference to the connection string, and, is in effect, identical to the first example.<BR><BR> Now, I&#039m not entirely sure if there is a benefit to keeping this variable &#039live&#039 within an application variable. In the past, I have used session variable to carry the connection string, but more recently, I have been making use of an include file.<BR><BR>The good news is that if you are regularly using the on each page, you are NOT keeping the database connection object open at the session or application level. However, if you had placed the within your global.asa file&#039s On_Session_Start or On_Application_Start events, then you are keeping the database open the entire time and you probably will run into some issues.<BR><BR>Hope this helps. Post again if there are any other questions.<BR>

Posting Permissions

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