-
Jul 11th, 2018, 07:18 PM
#1
Thread Starter
New Member
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
-
Jul 11th, 2018, 10:11 PM
#2
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.
-
Jul 13th, 2018, 03:16 PM
#3
Thread Starter
New Member
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?
-
Jul 13th, 2018, 11:47 PM
#4
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.
-
Jul 24th, 2018, 07:56 PM
#5
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|