dcsimg
Results 1 to 5 of 5

Thread: 3704 error Operation is not allowed wen the object is closed -IBM server client 10.5

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2018
    Posts
    3

    3704 error Operation is not allowed wen the object is closed -IBM server client 10.5

    I have VB6.0 windows application and the backend is db2. I'm using ODBC connections to connect to the DB2. My application works fine with the driver IBM server client 9.7 (in windows 7). When I run the same application with IBM Server Client 10.5 (in windows 10), it throws and error '3704 error Operation is not allowed when the object is closed' when It approaches this line in the code
    If RsRecord.BOF And RsRecord.EOF

    Here is the full code

    Dim RsRecord As ADODB.Recordset
    On Error GoTo ErrHandler

    lSQL$ = "SELECT GL_ACCNT FROM TC06U.TC_GL_ACCOUNT ORDER BY GL_ACCNT"

    Set RsRecord = New ADODB.Recordset
    RsRecord.Open lSQL$, gCnn

    If RsRecord.BOF And RsRecord.EOF Then
    'No Recs
    Else
    RsRecord.MoveFirst
    cboGLAcc.AddItem ""
    With RsRecord
    Do Until .EOF
    cboGLAcc.AddItem Trim$(.Fields(0))
    .MoveNext
    Loop
    .Close
    End With
    End If



    The same VB6.0 works fine for IBM Server Client 9.7 in windows 7.

    Is there a special configuration or settings I need to do to pass this line - RsRecord.BOF And RsRecord.EOF ??

    Also.. when I displayed gCnn - it is showing "Provider=MSDASQL.1;" - IS This wrong one for IBM Server Client 10.5??

    Please advise.

    Thanks,

    Claudia

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    12,472

    Re: 3704 error Operation is not allowed wen the object is closed -IBM server client

    My guess would be that your connection is not open. Apparently the code that does that is elsewhere and there are no checks there to insure it is open before trying to open a recordset on it. This will always fail if the connection is not open at the time.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2018
    Posts
    3

    Re: 3704 error Operation is not allowed wen the object is closed -IBM server client

    What do I need to do to ensure that the connection is open? Can you provide sample code?

  4. #4
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    12,472

    Re: 3704 error Operation is not allowed wen the object is closed -IBM server client

    The state property of the connection can tell you if it is open.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2018
    Posts
    3

    Re: 3704 error Operation is not allowed wen the object is closed -IBM server client

    Got that part - Thank you!

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width