Re: Operation not allowed when object is closed
- From: "Steve Gerrard" <mynamehere@xxxxxxxxxxx>
- Date: Tue, 7 Feb 2006 18:25:01 -0800
"Jennifer" <jennifer1970@xxxxxxxxxxx> wrote in message
news:1139346915.471660.203190@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am having problems trying to debug the message "Operation not allowed
when object is closed.". As far as I can tell the object in question
is open. Below is the code.
The error lies on the line " If RS.EOF = False Then ". Right before
that line I open the recordset.
While Not RSB.EOF
sBV = RSB("VendorCode").Value
RS.Open "EXEC sp_imOrdersToBePolled '" & sBV & "'", CN
If RS.EOF = False Then '<<---This is where the error is.
SYGFilePath = "C:\Out\Order" & StripSpecialChars(sBV) & "." &
UnitNumber
'......
'......more code here
'......
End If
Loop
Two ideas.
1. The line RS.Open "EXEC...." is inside the loop. There is no RS.Close inside
the loop. Maybe the error is occurring because you are opening the recordset
again without closing it first?
2. You are actually executing a stored procedure, not running a select query.
Maybe no recordset is returned by that procedure, so the recordset is never
actually opened. What is the RS.State property value after the Open call?
.
- Follow-Ups:
- Re: Operation not allowed when object is closed
- From: Jennifer
- Re: Operation not allowed when object is closed
- From: Jennifer
- Re: Operation not allowed when object is closed
- References:
- Operation not allowed when object is closed
- From: Jennifer
- Operation not allowed when object is closed
- Prev by Date: Install DLL already in use
- Next by Date: Re: Registered versions
- Previous by thread: Operation not allowed when object is closed
- Next by thread: Re: Operation not allowed when object is closed
- Index(es):
Relevant Pages
|