Object is closed

Results 1 to 2 of 2

Thread: Object is closed

  1. #1
    Join Date
    Dec 1969

    Default Object is closed

    I get an object is closed error from this:<BR>Error:<BR>ADODB.Connection (0x800A0E78)<BR>Operation is not allowed when the object is closed.<BR>/index.asp, line 8<BR><BR>ASP Code:<BR>&#060;%<BR>Dim oThe<BR><BR>Set oThe = Server.CreateObject("The.clsThe") &#039;&#039;&#039;This would be line 8<BR>%&#062;<BR>&#060;HTML&#062;...<BR><BR><BR><BR >The.dll<BR>Private Sub Class_Initialize()<BR>On Error GoTo Errhandler:<BR> &#039;Create a connection and recordset object<BR> Set mvConnection = New ADODB.Connection<BR> Set mvInternalRS = New ADODB.Recordset<BR> &#039;Open the connection<BR> mvConnection.ConnectionString = "Provider=MSDataShape;DSN=TheDB"<BR> mvConnection.Open<BR> <BR> Exit Sub<BR>Errhandler:<BR> mvConnection.Close<BR> Set mvConnection = Nothing<BR> Set mvInternalRS = Nothing<BR> Call MsgBox("Failed to initialize The.dll.", vbCritical + vbOKOnly)<BR>End Sub<BR>If it hits the error handler I get the object closed errror. <BR>I can&#039;t see where the object would be closed, Any hints on this?<BR>Chris

  2. #2
    Join Date
    Dec 1969

    Default Like this

    &nbsp;<BR> If mvConnection.State = adStateOpen then<BR> mvConnection.Close<BR> end if

Posting Permissions

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