Results 1 to 2 of 2

Thread: global.asa

  1. #1
    Join Date
    Dec 1969

    Default global.asa

    I really need some help with a global.asa problem. I&#039;ve tried everything, but nothing works. <BR>I have a global.asa file, everytime my host restarts their servers my asp scripts won&#039;t "connect" to the db through the global.asa. But as soon as I upload the exact like global.asa file again everything works. <BR><BR>here&#039;s the global.asa file: <BR><BR>Sub Application_OnStart <BR> Set Application("oConn")=Server.CreateObject("ADODB.Co nnection") <BR> Application("oConn").Open "Provider=SQLOLEDB;User ID=***;Password=***;Initial Catalog=***;Server=***" <BR>End Sub <BR><BR>I know I should open and close the connection in each script. But what am I doing wrong? I have other domains on the same server that is useing global.asa, but none of these need to be uploaded after a server restart, but these don&#039;t use SQL server, they use access. <BR><BR>What do I do? plz help <BR>I know I&#039;ve posted this before, but I never get any response. So i hope this time I will.

  2. #2
    Join Date
    Dec 1969

    Default never, ever do this

    you have a connection object in aplication scope. this is about the worst thing you can do. If you were at my studio and you did this I&#039;d yell at you so hard you&#039;d resign o the spot.<BR><BR>just put the connection **string** in an application variable, and open and close your connection in each page. this codwe sample has effectively lockled your webserver down to a single thread, destroying all the advantages a multi-threaded server offers, and killing off connection pooling utterly.<BR><BR>really, really bad thing to do. I can&#039;t emphasise this enough.

Posting Permissions

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