Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object is not found...
Message
 
 
To
20/08/2009 13:08:26
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01419283
Message ID:
01419285
Views:
53
>Hi friends:
>
>I have a few systems working in VFP 9.0 and there are not many problems
>
>But...
>
>From time to time an inexplicable error appears.
>
>I mention this for example only:
>
>At start I create an object named "oentorno" where I save "SETs" for restoring them before finish the system.
>
>Suddenly an instruction as "SELECT CCOSTOS" (a cursor) provokes an error.
>
>There's not a logical (for my humble level) reason for that error.
>
>Error events executes and tries to open a table to register the error.
>
>When I open every table I use a routine (in a PRG file) having this instruction:
>
>USE (OENTORNO.AENTORNO(17)+'FILES') IN 0
>
>Another error appears:
>
>"Object OENTORNO not found"
>
>I know there are many experts among you, friends. Please remember when you were babys (as me) programing perhaps you encountered this kind of errors and you can explain me
>
>I must say the 99% of times error events works well, I find the reason and I fix it up.
>
>But I'm really upset when I can't tell my clients: "I've made a mistake" because the same program I executes n times at n+x explodes..
>
>I thank you very much in advance for your time.
>
> Héctor

Hi Hector,

It appears that some process or routine closes the cursor CCOSTOS (probably not always). Therefore, you may want to check if the cursor is open before selecting. For example
if select("CCOSTOS") > 0
   select CCOSTOS
else
  *-- Problem!
endif 
The same is true when you try to open file FILE and calling OENTORNO.AENTORNO. Something possibly destroys the object oEntorno before you try to use it.

HTH
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform