473,769 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ADO Connection object in Session_OnEnd

Hi!
Why doesn't the following code work?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Connection String = Application("Co nnection_String ")
Conn.Open 'here is the error
....
End Sub
A Conn object is created the same way in Session_OnStart and is used
throughout the application, and Application("Co nnection_String ") still
exists here (I tested).
So I suppose the error is caused by the fact that we are in Session_OnEnd.
Jul 19 '05 #1
14 3966
>A Conn object is created the same way in Session_OnStart and is used
throughout the application
O, Boy thats a bad idea

--
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com
"Agoston Bejo" <gu***@freemail .hu> wrote in message
news:OO******** ******@TK2MSFTN GP11.phx.gbl... Hi!
Why doesn't the following code work?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Connection String = Application("Co nnection_String ")
Conn.Open 'here is the error
...
End Sub
A Conn object is created the same way in Session_OnStart and is used
throughout the application, and Application("Co nnection_String ") still
exists here (I tested).
So I suppose the error is caused by the fact that we are in Session_OnEnd.

Jul 19 '05 #2
It might help if you tell us WHAT error.

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Agoston Bejo" <gu***@freemail .hu> wrote in message
news:OO******** ******@TK2MSFTN GP11.phx.gbl...
Hi!
Why doesn't the following code work?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Connection String = Application("Co nnection_String ")
Conn.Open 'here is the error
...
End Sub
A Conn object is created the same way in Session_OnStart and is used
throughout the application, and Application("Co nnection_String ") still
exists here (I tested).
So I suppose the error is caused by the fact that we are in Session_OnEnd.

Jul 19 '05 #3
Agoston Bejo wrote:
Hi!
Why doesn't the following code work?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Connection String = Application("Co nnection_String ")
Conn.Open 'here is the error
What is the error? I suggest instead of posting it here, you go to
aspfaq.com and search for it there. You may get your answer quicker.
...
End Sub
A Conn object is created the same way in Session_OnStart and is used
throughout the application, and Application("Co nnection_String ") still
exists here (I tested).

http://www.aspfaq.com/2053
So I suppose the error is caused by the fact that we are in
Session_OnEnd.


Who can say without knowing what the error is?

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"
Jul 19 '05 #4

"Roji. P. Thomas" <la********@now here.com> wrote in message
news:e%******** ********@TK2MSF TNGP11.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, 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.

--
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com
"Agoston Bejo" <gu***@freemail .hu> wrote in message
news:OO******** ******@TK2MSFTN GP11.phx.gbl...
Hi!
Why doesn't the following code work?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Connection String = Application("Co nnection_String ")
Conn.Open 'here is the error
...
End Sub
A Conn object is created the same way in Session_OnStart and is used
throughout the application, and Application("Co nnection_String ") still
exists here (I tested).
So I suppose the error is caused by the fact that we are in

Session_OnEnd.


Jul 19 '05 #5
Yes, how silly of me, I forgot that little detail:

Error message:
"Requested operation requires an OLE DB Session object, which is not
supported by the current provider."
"Aaron [SQL Server MVP]" <te*****@dnartr eb.noraa> wrote in message
news:eK******** ******@TK2MSFTN GP12.phx.gbl...
It might help if you tell us WHAT error.

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Agoston Bejo" <gu***@freemail .hu> wrote in message
news:OO******** ******@TK2MSFTN GP11.phx.gbl...
Hi!
Why doesn't the following code work?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Connection String = Application("Co nnection_String ")
Conn.Open 'here is the error
...
End Sub
A Conn object is created the same way in Session_OnStart and is used
throughout the application, and Application("Co nnection_String ") still
exists here (I tested).
So I suppose the error is caused by the fact that we are in Session_OnEnd.


Jul 19 '05 #6
And what is the value of Application("Co nnection_String ") ?

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Agoston Bejo" <gu***@freemail .hu> wrote in message
news:un******** ******@TK2MSFTN GP15.phx.gbl...
Yes, how silly of me, I forgot that little detail:

Error message:
"Requested operation requires an OLE DB Session object, which is not
supported by the current provider."
"Aaron [SQL Server MVP]" <te*****@dnartr eb.noraa> wrote in message
news:eK******** ******@TK2MSFTN GP12.phx.gbl...
It might help if you tell us WHAT error.

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Agoston Bejo" <gu***@freemail .hu> wrote in message
news:OO******** ******@TK2MSFTN GP11.phx.gbl...
Hi!
Why doesn't the following code work?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Connection String = Application("Co nnection_String ")
Conn.Open 'here is the error
...
End Sub
A Conn object is created the same way in Session_OnStart and is used
throughout the application, and Application("Co nnection_String ") still
exists here (I tested).
So I suppose the error is caused by the fact that we are in Session_OnEnd.



Jul 19 '05 #7
Agoston Bejo wrote:
"Roji. P. Thomas" <la********@now here.com> wrote in message
news:e%******** ********@TK2MSF TNGP11.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)?

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"
Jul 19 '05 #8
Agoston Bejo wrote:
Yes, how silly of me, I forgot that little detail:

Error message:
"Requested operation requires an OLE DB Session object, which is not
supported by the current provider."

Hmm. What provider are you using?

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"
Jul 19 '05 #9
"Provider=OraOL EDB.Oracle.1;Da ta Source=***;User ID=***;Password =***;Persist
Security Info=True;PLSQL RSet=1;"

Sorry, but I don't think I should provide the information that I've replaced
with ***.
I'm connecting to an Oracle 8.1.7 server.
Anyway, believe me that it works this way outside Session_OnEnd, since I
copied
it from Session_OnStart .

Many thanks

"Aaron [SQL Server MVP]" <te*****@dnartr eb.noraa> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
And what is the value of Application("Co nnection_String ") ?

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Agoston Bejo" <gu***@freemail .hu> wrote in message
news:un******** ******@TK2MSFTN GP15.phx.gbl...
Yes, how silly of me, I forgot that little detail:

Error message:
"Requested operation requires an OLE DB Session object, which is not
supported by the current provider."
"Aaron [SQL Server MVP]" <te*****@dnartr eb.noraa> wrote in message
news:eK******** ******@TK2MSFTN GP12.phx.gbl...
It might help if you tell us WHAT error.

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Agoston Bejo" <gu***@freemail .hu> wrote in message
news:OO******** ******@TK2MSFTN GP11.phx.gbl...
> Hi!
> Why doesn't the following code work?
>
> Sub Session_OnEnd
> Dim Conn
> Set Conn = Server.CreateOb ject("ADODB.Con nection")
> Conn.Connection String = Application("Co nnection_String ")
> Conn.Open 'here is the error
> ...
> End Sub
>
>
> A Conn object is created the same way in Session_OnStart and is used
> throughout the application, and Application("Co nnection_String ") still > exists here (I tested).
> So I suppose the error is caused by the fact that we are in

Session_OnEnd.
>
>



Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
9518
by: MostlyH2O | last post by:
Hi Folks, I'm having a hard time getting my Session_OnEnd event to fire in my global.asa. Here's what I have: <SCRIPT LANGUAGE=VBSCRIPT RUNAT=Server> SUB Session_OnStart Session.TimeOut = 30 END SUB
3
3071
by: Tom Bates | last post by:
I can successfully delete files using fso.DeleteFile when in an ASP script. But in Session_OnEnd, where I'd *really* like to clean up files, it appears that DeleteFile doesn't work. I've tried every combination I could think of. I've verified the filespecs I'm using by logging to a session log file. BTW, I found out the hard way that I can't reference Request.ServerVariables("APPL_PHYSICAL_PATH") from within Session_OnEnd. I had to copy...
24
2463
by: Nancy Drew | last post by:
hi all i'm trying to keep users from being able to login to a site twice at the same time. everytime a user does a login, i stick their userID into an application scoped array. if they try to login again, i bounce them to an error page. i use the session_onEnd sub within global.asa to remove their userID from the array at the end of their session, and this seems to work fine. however, if i just shut down the browser, the sub_onEnd...
4
6825
by: Propin | last post by:
Have a problem with below code in global.asa. Same problem as described in this news group before, IWAM_machinename did not solve my problem. Have created the following test code (file is never deleted on my IIS6 Win2003 environment, any idea?): <SCRIPT LANGUAGE="VBScript" RUNAT="Server"> Sub Application_OnStart End Sub
4
2581
by: anand | last post by:
In my website i want to trace the event when user log off from the site by closing the explorer so i am unable to run any server side program at that time and my session_onend event also not working can any one tell me why the session_onend is not working. Thanx in advance
6
2597
by: Martin | last post by:
Hi, Since I went ASP.NET with my global.asa (making it a global.asax) the application events are called just fine as well as the Session_OnStart event but the Session_OnEnd event is not. What is wrong? My global.asax looks like this: <%@ Application src="app.cs" Inherits="mwte.App" %>
1
2140
by: Andy Kasotia | last post by:
My Session_OnStart works but Session_OnEnd does not work. Here's the code...can anyone tell me what's wrong with my code or if anything else on the server that needs to be changed. The Session_OnStart does create the folder for me with the SessionID as the folder name but Session_OnEnd does not delete that folder. Sub Session_OnStart Dim fso, f, DirToCreate 'Create a folder to store PDF Files Set fso =...
11
2110
by: David Thielen | last post by:
Hi; Is there some kind of session ID variable that I can get in the code behind and that is available in Session_OnEnd() to know what session ended? -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com
4
1641
by: Chris Ashley | last post by:
There seem to be isolated occurences of Session_OnEnd not firing in my app. This is problematic because some clean up of resources happens here. I know the Session events were unreliable in classic ASP, but is this still the case in ASP.Net? What kind of scenarios would case Session_OnEnd not to fire? Would Application_Error being hit cause Session_OnEnd not to fire?
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10043
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.