Re: ADO Connection object in Session_OnEnd

From: Agoston Bejo (gusz1_at_freemail.hu)
Date: 09/24/04


Date: Fri, 24 Sep 2004 15:45:14 +0200


"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:Oz2Y$sjoEHA.1992@TK2MSFTNGP09.phx.gbl...
> Agoston Bejo wrote:
> > "Roji. P. Thomas" <lazydragon@nowhere.com> wrote in message
> > news:e%23QppljoEHA.3428@TK2MSFTNGP11.phx.gbl...
> >>> A Conn object is created the same way in Session_OnStart and is used
> >>> throughout the application
> >
> >>
> >> O, Boy thats a bad idea
> >
> > Yeah, yeah, I think I know what you mean,
>
> Maybe you do, but your next statement makes me doubt it.
>
> > but as far as I know, it's
> > not that bad idea if you close the connection at the end of every asp
> > page and reopen it at the beginning of them.
> >
> Then what's the point of opening it in Session_OnStart? Maybe you misspoke
> in your earlier message. When you said " ... and is used throughout the
> application", were you talking about the connection object (bad) or the
> connection string (good)?

It isn't opened in Session_OnStart.
In Session_OnEnd I open it only because I create a new Connection object.
(That part --"Conn.Open"-- doesn't come from Session_OnStart, all right.)
Actually, the connection object is put into a Session variable, and is
reopened and closed every time an asp page is processed.
>From what you (and the others) say, it shouldn't be done this way, and I
should create a new Connection object in every asp page. Right?

Anyway, the original problem has not much to do with this, so let's now
concentrate on that part. (Why doesn't the newly created Connection
object --initialized with a valid connection string-- work in
Session_OnEnd?)

Thx

>
> Bob Barrows
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>



Relevant Pages

  • Re: ADO Connection object in Session_OnEnd
    ... > Agoston Bejo wrote: ... >> Yeah, yeah, I think I know what you mean, ... In Session_OnEnd I open it only because I create a new Connection object. ... reopened and closed every time an asp page is processed. ...
    (microsoft.public.scripting.vbscript)
  • Re: ADO Connection object in Session_OnEnd
    ... > Agoston Bejo wrote: ... >> Yeah, yeah, I think I know what you mean, ... In Session_OnEnd I open it only because I create a new Connection object. ... reopened and closed every time an asp page is processed. ...
    (microsoft.public.inetserver.asp.db)
  • Re: ADO Connection object in Session_OnEnd
    ... > Agoston Bejo wrote: ... >> Yeah, yeah, I think I know what you mean, ... In Session_OnEnd I open it only because I create a new Connection object. ... reopened and closed every time an asp page is processed. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Help needed with ADO Update
    ... Several vbscript examples show the same usage, ... This is ASP using vbscript, ... References suggest that it is an option to pass the connection object ... recordsets should be used exclusively for retrieving ...
    (microsoft.public.data.ado)
  • Re: ADO.Net connection object in Classic ASP
    ... I know that my ASP ... occurs when I try to call a function returning a Connection object. ... Eg. dbConn= MyCom.GetConnObj ... Can I use the same .Net Connection Object in my ...
    (microsoft.public.dotnet.framework.interop)