LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Operation is not allowed when the object is closed

I am getting data from DB2 and importing into excel. It seems that
when I pull a lot of data I get an error. In debug mode when I look
at the recordset items it says <Operation is not allowed when the
object is closed.

My code looks like this:

Dim oConn As ADODB.Connection
Dim oRs As ADODB.Recordset

sConn = "Persist Security Info=False;Database=MYDB;" & _
"Driver={IBM DB2 ODBC DRIVER};" & _
"Protocol=TCPIP;Hostname=MYDB.XXX.COM;Port=446 ;" & _
"USER ID=" & userid & "; PASSWORD=" & password & ";"

Set oConn = New ADODB.Connection
oConn.Open sConn
Set oRs = New ADODB.Recordset
oRs.Open aSQLCmd, oConn, adOpenStatic, adLockReadOnly, adCmdText

Any idea what is wrong?

Thanks.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing a recordset error : Operation is not allowed when...is clo NateBuckley Excel Programming 3 May 20th 08 01:06 PM
Operation is not allowed Geetha Excel Programming 0 July 5th 07 11:06 PM
object is closed mike Excel Programming 1 June 4th 05 11:17 AM
"operation is not allowed when the object is closed" error when us madhouse Excel Programming 0 January 12th 05 09:05 AM
Operation Is Not Allowed When The Object Is Closed Mike Carlson Excel Programming 4 October 29th 03 02:18 AM


All times are GMT +1. The time now is 06:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"