Operation

what does it mean operation not aloud in this context.

I have closed all of my recordsets etc and set them to nothing.What else does this mean?
LVL 8
thenoneAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

EDDYKTCommented:
If you search "operation not allow in this context" on EE, you will get a lot of returns talking about this. We need to get more info in order to determine

8->
Leo EikelmanDirector, IT and Business DevelopmentCommented:
say you have a record set called rsSubMain, then try this

If rsSubMain.State = 1 Then
    rsSubMain.Close
    rsSubMain = Nothing
End If

Leo

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
thenoneAuthor Commented:
ok I have already done this and it still happens.The weird thing is it doesn't happen all of the time.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Leo EikelmanDirector, IT and Business DevelopmentCommented:
post your code please

Leo
daniel_j_cCommented:
if you want to be really safe, you could do something like this (assuming the problem is occuring at cleanup)

if not rsSubMain is nothing then
  if rsSubMain.State <> adStateClosed then rsSubMain.close
  set rsSubMain = nothing
end if
thenoneAuthor Commented:
I can't post all of my code because I have alot of active x components and it wouldn't make since but I will give you the breakdown scenario.

I have

on error goto errorhandler:
conn.open
rs.open

some events

and then

rs.close
conn.close
set rs = nothing
set conn = nothing

errorhandler:
rs.delete
rs.movenext
rs.close
conn.close
set rs=nothing
set conn=nothing
EDDYKTCommented:
how do you open your recordset? client or server side cursor? etc
thenoneAuthor Commented:
client not server
EDDYKTCommented:
if it is client side, then as long as you do not update to server

then remove these lines

rs.delete
rs.movenext
thenoneAuthor Commented:
The thing is I update to the server if there is an error I have to move to the next record.Its just the weirdest thing if that was the case then I would get the error all of the time.
Leo EikelmanDirector, IT and Business DevelopmentCommented:
So I am assuming you are using something like this

if not rsSubMain is nothing then
  if rsSubMain.State <> adStateClosed then rsSubMain.close
  set rsSubMain = nothing
end if


it's just not posted in the code right?  I also assume you are checking if NOT rs.EOF before the delete and movenext.


Also, it is generally not a good idea to DELETE with a recordset.  You should use the connection object and use an SQL delete statement, such as

objConnection.Execute "Delete FROM ComboData where SOME CONDITIONS"



Leo
thenoneAuthor Commented:
so you are saying add this to every asspect of closing the record in my function

if not rs is nothing then
  if rs.State <> adStateClosed then rs.close
  set rs = nothing
end if
Leo EikelmanDirector, IT and Business DevelopmentCommented:
yes.

Also, set this property for yoru connection before opening it.

conn.CursorLocation = adUseClient


Leo
thenoneAuthor Commented:
Thanks leo I will give that a try.It just puzzles me that it doesn't happen all of the time.
Also could you help me with this question if you do not mind.I will post points tonight.

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21819238.html
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.