ADO Connection object in Session_OnEnd

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


Date: Fri, 24 Sep 2004 15:12:38 +0200

Hi!
Why doesn't the following code work?

Sub Session_OnEnd
 Dim Conn
 Set Conn = Server.CreateObject("ADODB.Connection")
 Conn.ConnectionString = Application("Connection_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("Connection_String") still
exists here (I tested).
So I suppose the error is caused by the fact that we are in Session_OnEnd.



Relevant Pages

  • Re: Connection Problem
    ... > Global Conn As ADODB.Connection ... > Public Sub Connect ... So get rid of the line "Dim Conn As ADODB.Connection" inside the Sub, ... make sure the connection gets closed when you're done with it, ...
    (microsoft.public.vb.database.ado)
  • Re: ADO connection state and object destruction Problem/Question
    ... Public Function FindEmployees(ByVal Name As String, ... Dim strDesc As String ... Dim conn As ADODB.Connection ... Public Sub ClearErrorInfo(ByRef lngErr As Long, ByRef strDesc As String, _ ...
    (microsoft.public.data.ado)
  • Re: Using web service
    ... > from the Access database to keep the sample simple) ... > Private conn As New ... > End Sub ... >> You can just move it into the dataset of the acces file, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Access project + VBA
    ... Currently developing a project in database. ... Dim conn As New ADODB.Connection ... Set conn = New ADODB.Connection ...
    (comp.databases.ms-access)
  • Re: Issues with datagridview last record updating sql database
    ... and my data is in my datagrid, ... Public Sub LoadStructural() ... conn = New SqlConnection ... da.SelectCommand = New SqlCommand ...
    (microsoft.public.dotnet.languages.vb)