Ask a Question related to ASP Database, Design and Development.
-
Tony #1
Global.asa Problem
I have recently upgraded to IIS6 and was not experiencing these problems in
IIS5. The global.asa reads:
<SCRIPT LANGUAGE='VBScript' RUNAT='Server'>
'EventName Description
'Session_OnStart Runs the first time a user runs any page in your
application
'Session_OnEnd Runs when a user's session times out or quits your
application
'Application_OnStart Runs once when the first page of your application is
run for the first time by any user
'Application_OnEnd Runs once when the web server shuts down
' Global Variables
'Dim Session("DB") ' Database Object
'Dim Session("bLocal") ' Is a local client or not
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''
'''''''''''''''''''''''''''''
' Main Subroutines
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''
'''''''''''''''''''''''''''''
Sub Session_OnStart
Set Session("DB") = Server.CreateObject("ADODB.Connection")
Session("DB").Open("OSC")
'CheckLocal
End Sub
Sub Session_OnEnd
******Session("DB").Close
End Sub
Where is **** is at is where the event log says there is a problem please
help.
Thanks,
Tony
Tony Guest
-
global groups problem
Hi, I am not able to add global groups that I have recently created into other global groups, these too recently created. The problem is... -
global variable problem
I want a counter progCounter to count the number of times that the frame is entered. Ultimately, I would like it to count the number of times that... -
Problem with global variables
Hi All, I'm turning mad with global variables... In created a simple test script with 2 functions which worked fine but the other one i need... -
global.asax problem
Hi all! I've created a simple aspx application and when I run it locally on my pc all works fine. If I move it on the web server I get the... -
global/screensaver problem
If the frame <> 123 then ... do something the Label function returns the frame number for a given marker name: if the frame <>... -
Alan #2
Re: Global.asa Problem
I don't know what you're specific problem is, but you shouldn't be opening
and caching a connection in the session. You should be opening and closing
it as required in your code - you're just wasting resources otherwise.
You've probably used this approach because it looks nice and neat, but you
can still achieve the same thing with some thoughtful coding without
resorting to the spaghetti mess of connections and recordsets seen in a lot
of ASP code.
Food for thought.
Cheers,
Alan
"Tony" <tony@optics.arizona.edu> wrote in message
news:uy#QSTfYDHA.1280@tk2msftngp13.phx.gbl...in> I have recently upgraded to IIS6 and was not experiencing these problemsis> IIS5. The global.asa reads:
> <SCRIPT LANGUAGE='VBScript' RUNAT='Server'>
>
> 'EventName Description
> 'Session_OnStart Runs the first time a user runs any page in your
> application
> 'Session_OnEnd Runs when a user's session times out or quits your
> application
> 'Application_OnStart Runs once when the first page of your application'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''> run for the first time by any user
> 'Application_OnEnd Runs once when the web server shuts down
>
> ' Global Variables
> 'Dim Session("DB") ' Database Object
> 'Dim Session("bLocal") ' Is a local client or not
>
>'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''> '''''''''''''''''''''''''''''
> ' Main Subroutines
>> '''''''''''''''''''''''''''''
> Sub Session_OnStart
> Set Session("DB") = Server.CreateObject("ADODB.Connection")
> Session("DB").Open("OSC")
> 'CheckLocal
> End Sub
>
> Sub Session_OnEnd
> ******Session("DB").Close
> End Sub
>
> Where is **** is at is where the event log says there is a problem please
> help.
>
> Thanks,
>
> Tony
>
>
Alan Guest
-
Adrian Forbes - MVP #3
Global.asa Problem
Don't waste any time looking into this. OLEDB does what
you are trying to do under the covers. When you close a
connection it is not actually closed but put into a pool,
so if another process creates one and a suitable
connection is in the pool it gets the pooled version.
Doing what you are doing stops OLEDB managing the pool and
OLEDB is doing a better job of it than your code is. What
would happen when 1000 users all access your site? They
get 1000 permanent connections, where if you let oledb
handle pooling you will have all 1000 users serviced by
maybe 5 or 10 connections instead.
Open a connection in your code when you need it, and close
it right after.
these problems in>-----Original Message-----
>I have recently upgraded to IIS6 and was not experiencingany page in your>IIS5. The global.asa reads:
><SCRIPT LANGUAGE='VBScript' RUNAT='Server'>
>
>'EventName Description
>'Session_OnStart Runs the first time a user runsout or quits your>application
>'Session_OnEnd Runs when a user's session timesyour application is>application
>'Application_OnStart Runs once when the first page ofshuts down>run for the first time by any user
>'Application_OnEnd Runs once when the web server''''''''''''''''''>
>' Global Variables
>'Dim Session("DB") ' Database Object
>'Dim Session("bLocal") ' Is a local client or not
>
>''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''>'''''''''''''''''''''''''''''
>' Main Subroutines
>''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''("ADODB.Connection")>'''''''''''''''''''''''''''''
>Sub Session_OnStart
> Set Session("DB") = Server.CreateObjecta problem please> Session("DB").Open("OSC")
> 'CheckLocal
>End Sub
>
>Sub Session_OnEnd
> ******Session("DB").Close
>End Sub
>
>Where is **** is at is where the event log says there is>help.
>
>Thanks,
>
>Tony
>
>
>.
>Adrian Forbes - MVP Guest



Reply With Quote

