Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Operation

Posted on 2006-04-19
14
Medium Priority
?
214 Views
Last Modified: 2010-05-01
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?
0
Comment
Question by:thenone
  • 6
  • 4
  • 3
  • +1
14 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 16486641
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->
0
 
LVL 8

Accepted Solution

by:
Leo Eikelman earned 2000 total points
ID: 16487054
say you have a record set called rsSubMain, then try this

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

Leo
0
 
LVL 8

Author Comment

by:thenone
ID: 16487203
ok I have already done this and it still happens.The weird thing is it doesn't happen all of the time.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 8

Expert Comment

by:Leo Eikelman
ID: 16487338
post your code please

Leo
0
 
LVL 2

Expert Comment

by:daniel_j_c
ID: 16488211
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
0
 
LVL 8

Author Comment

by:thenone
ID: 16488461
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
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 16488565
how do you open your recordset? client or server side cursor? etc
0
 
LVL 8

Author Comment

by:thenone
ID: 16488670
client not server
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 16488709
if it is client side, then as long as you do not update to server

then remove these lines

rs.delete
rs.movenext
0
 
LVL 8

Author Comment

by:thenone
ID: 16488787
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.
0
 
LVL 8

Expert Comment

by:Leo Eikelman
ID: 16489051
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
0
 
LVL 8

Author Comment

by:thenone
ID: 16489096
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
0
 
LVL 8

Expert Comment

by:Leo Eikelman
ID: 16489113
yes.

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

conn.CursorLocation = adUseClient


Leo
0
 
LVL 8

Author Comment

by:thenone
ID: 16489248
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
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question