Results 1 to 2 of 2

Thread: Global.asa

  1. #1
    Join Date
    Dec 1969

    Default Global.asa

    I want to create a global.asa file where I include this info....<BR><BR>MYDSN="DSN=dsnname;UID=;PWD=;"<BR> set DbObj=server.createobject("ADODB.connection")<BR>D MYDSN<BR><BR>In my global.asa file, I have something like this........<BR><BR>&#060;OBJECT RUNAT=SERVER SCOPE=SESSION ID=cnn ProgId="ADODB.Connection"&#062; &#060;/OBJECT&#062;<BR><BR>sub Application_OnStart()<BR><BR> &#039Creates connection to database<BR> Application("ConnectionString") = "DSN="dsnname"<BR> Application("UserID") = ""<BR> Application("Password") = ""<BR><BR>end sub <BR><BR>This is not working. Please help<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Global.asa

    Trust me, you don&#039t want to do this! Placing database connections in the Session is asking for trouble. It is best to just open a new connection whenever it is needed, on each ASP page. Open it, then close it. The below URLs explain why placing connection objects in the session is a bad idea. Happy Programming!<BR><BR><BR><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