'3709': Operation is not allowed on an object referencing a closed or invalid connection 
Author Message
 '3709': Operation is not allowed on an object referencing a closed or invalid connection

Hello All,

I am using W2K, Microsoft Visual Studio 6.0 and made the
database in Access 2000.

'*********** Code ********
' -----------------------  Code in Module ----------------------
Public Myconn As New ADODB.Connection

Public Function Connect2DB()
    strConnectString = "DSN=ISS;UID=SA;PWD=;"
    Myconn.ConnectionTimeout = 0
    Myconn.Open strConnectString
    Myconn.CommandTimeout = 0
End Function
' ----------------------- ----------------------

' -----------------------  Code in form ----------------------
Private Sub Form_Load()
    Dim rsData As New ADODB.Record

    strSQL = "SELECT * from Item where nIteNo = 99318"
    rsData.Open strSQL, Myconn        ' <<<<<<<<<<<<<<< Error occurs here >>>>>>>>>>>
End Sub
' ----------------------- ----------------------

'************************************

At line
rsData.Open strSQL, Myconn

I'm getting error
'3709': Operation is not allowed on an object referencing a closed or invalid connection

Any help please......

Anand D



Wed, 25 May 2005 15:09:53 GMT  
 '3709': Operation is not allowed on an object referencing a closed or invalid connection
You don't call Connect2DB, so the connection object never gets initialized.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele


Hello All,

I am using W2K, Microsoft Visual Studio 6.0 and made the
database in Access 2000.

'*********** Code ********
' -----------------------  Code in Module ----------------------
Public Myconn As New ADODB.Connection

Public Function Connect2DB()
    strConnectString = "DSN=ISS;UID=SA;PWD=;"
    Myconn.ConnectionTimeout = 0
    Myconn.Open strConnectString
    Myconn.CommandTimeout = 0
End Function
' ----------------------- ----------------------

' -----------------------  Code in form ----------------------
Private Sub Form_Load()
    Dim rsData As New ADODB.Record

    strSQL = "SELECT * from Item where nIteNo = 99318"
    rsData.Open strSQL, Myconn        ' <<<<<<<<<<<<<<< Error occurs here
End Sub
' ----------------------- ----------------------

'************************************

At line
rsData.Open strSQL, Myconn

I'm getting error
'3709': Operation is not allowed on an object referencing a closed or
invalid connection
Any help please......

Anand D



Wed, 25 May 2005 22:07:09 GMT  
 '3709': Operation is not allowed on an object referencing a closed or invalid connection

Add  call Connect2DB  in Form_load, as under:-

   Private Sub Form_Load()

    call Connect2DB     'Add this line <---------------

    Dim rsData As New ADODB.Record

    strSQL = "SELECT * from Item where nIteNo = 99318"
    rsData.Open strSQL, Myconn        ' <<<<<<<<<<<<<<< Error occurs here >>>>>>>>>>>
End Sub

Best Regards,

Luqman


  Hello All,

  I am using W2K, Microsoft Visual Studio 6.0 and made the
  database in Access 2000.

  '*********** Code ********
  ' -----------------------  Code in Module ----------------------
  Public Myconn As New ADODB.Connection

  Public Function Connect2DB()
      strConnectString = "DSN=ISS;UID=SA;PWD=;"
      Myconn.ConnectionTimeout = 0
      Myconn.Open strConnectString
      Myconn.CommandTimeout = 0
  End Function
  ' ----------------------- ----------------------

  ' -----------------------  Code in form ----------------------
  Private Sub Form_Load()

      call Connect2DB     'Add this line <---------------

      Dim rsData As New ADODB.Record

      strSQL = "SELECT * from Item where nIteNo = 99318"
      rsData.Open strSQL, Myconn        ' <<<<<<<<<<<<<<< Error occurs here >>>>>>>>>>>
  End Sub
  ' ----------------------- ----------------------

  '************************************

  At line
  rsData.Open strSQL, Myconn

  I'm getting error
  '3709': Operation is not allowed on an object referencing a closed or invalid connection

  Any help please......

  Anand D



Fri, 27 May 2005 04:33:26 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Run-time error '3709' Application requested a reference to a invalid or closed connection object

2. Operation is not allowed when the object is closed

3. Operation is not allowed when the object is closed

4. Operation is not allowed when the object is closed and CommanTimeout,

5. Operation is not allowed when the object is closed

6. operation is not allowed when the object is closed

7. Operation is not allowed when the object is closed

8. Stored Proc problems - Operation not allowed when the object is closed

9. Operation is not allowed when the object is closed - error

10. operation not allowed when object is closed

11. Run time error '3709' - Please Help

12. Findfirst gives an error 3251 'operation is not supported for this type of object

 

 
Powered by phpBB® Forum Software