Fetch Not Working (C5EE & ABC) 
Author Message
 Fetch Not Working (C5EE & ABC)

When using :

access:customer.clearkey(cus:surname_key)
cus:surname = 'SMITH'
If access:customer.fetch(cus:surname_key) = Level:Benign
    ....some code....
End

I get the error 'Attempting to use file (CUSTOMER) before it was opened.
Press OK to end this application'

CUSTOMER is in the FILE list of the form. If I put a SHARE(CUSTOMER) command
in before the above code, I get the error "File Already Open". If I put a
STOP(Error()) after the clearkey line I get "Entry Not Found".

If I use the good old-fashioned
Clear(cus:record)
cus:surname = 'SMITH'
Get(customer,cus:surname_key)

No problem at all, the information from CUSTOMER file is retrieved with no
problem.

Why doesn't the ABC code work?

Thanks in advance

Bryan



Sun, 16 Sep 2001 03:00:00 GMT  
 Fetch Not Working (C5EE & ABC)
Hi PC:

I think the Level:Benign returns Zero so your statement can't work. I have used

CUS:CustID = SomeVariable
CASE Access:Customers.Fetch(CUS:BySomeKey)
    OF Level:Benign
        Do something here.
END

Any help?

Ken Wagner

Quote:

> When using :

> access:customer.clearkey(cus:surname_key)
> cus:surname = 'SMITH'
> If access:customer.fetch(cus:surname_key) = Level:Benign
>     ....some code....
> End

> I get the error 'Attempting to use file (CUSTOMER) before it was opened.
> Press OK to end this application'

> CUSTOMER is in the FILE list of the form. If I put a SHARE(CUSTOMER) command
> in before the above code, I get the error "File Already Open". If I put a
> STOP(Error()) after the clearkey line I get "Entry Not Found".

> If I use the good old-fashioned
> Clear(cus:record)
> cus:surname = 'SMITH'
> Get(customer,cus:surname_key)

> No problem at all, the information from CUSTOMER file is retrieved with no
> problem.

> Why doesn't the ABC code work?

> Thanks in advance

> Bryan



Sun, 16 Sep 2001 03:00:00 GMT  
 Fetch Not Working (C5EE & ABC)
access:customer.fetch(cus:....) returns a zero if successful. Level:Benign
equates to zero, so there is no reason why it shouldn't work. What I've done
is the same as using CASE.

Anyway it seems to be the clearkey line that is producing the error, not the
fetch.

Thanks anyway

Bryan


Quote:
> Hi PC:

> I think the Level:Benign returns Zero so your statement can't work. I have
used

> CUS:CustID = SomeVariable
> CASE Access:Customers.Fetch(CUS:BySomeKey)
>     OF Level:Benign
>         Do something here.
> END

> Any help?

> Ken Wagner



Sun, 16 Sep 2001 03:00:00 GMT  
 Fetch Not Working (C5EE & ABC)
You probably need an Access:Customer.Usefile() before the ClearKey even if
you have already opened the file.

Quote:

>access:customer.fetch(cus:....) returns a zero if successful. Level:Benign
>equates to zero, so there is no reason why it shouldn't work. What I've
done
>is the same as using CASE.

>Anyway it seems to be the clearkey line that is producing the error, not
the
>fetch.

>Thanks anyway

>Bryan



>> Hi PC:

>> I think the Level:Benign returns Zero so your statement can't work. I
have
>used

>> CUS:CustID = SomeVariable
>> CASE Access:Customers.Fetch(CUS:BySomeKey)
>>     OF Level:Benign
>>         Do something here.
>> END

>> Any help?

>> Ken Wagner



Sun, 16 Sep 2001 03:00:00 GMT  
 Fetch Not Working (C5EE & ABC)
Hi Bryan,



Quote:
>When using :

>access:customer.clearkey(cus:surname_key)
>cus:surname = 'SMITH'
>If access:customer.fetch(cus:surname_key) = Level:Benign
>    ....some code....
>End

>I get the error 'Attempting to use file (CUSTOMER) before it was opened.
>Press OK to end this application'

Add this line before the ClearKey():

 Access:Customer.UseFile()

Best regards,

Arnor Baldvinsson        
[Team Topspeed - Internet Connect]
Allerup Edb
Denmark

Check out Icetips and Icetips Knowledgebase
http://www.icetips.com
UIN nr.: 2428601



Sun, 16 Sep 2001 03:00:00 GMT  
 Fetch Not Working (C5EE & ABC)
Thanks Arnor, but  that made no difference, but adding:

Access:Customer.Open()

made it work.

Now the question is, why do I have to do that. Isn't the opening of files
handled by putting them in the FILES list?

Bryan


Quote:
> Hi Bryan,

> Add this line before the ClearKey():

>  Access:Customer.UseFile()

> Best regards,

> Arnor Baldvinsson
> [Team Topspeed - Internet Connect]
> Allerup Edb
> Denmark

> Check out Icetips and Icetips Knowledgebase
> http://www.icetips.com
> UIN nr.: 2428601



Mon, 17 Sep 2001 03:00:00 GMT  
 Fetch Not Working (C5EE & ABC)
Hi Bryan,

Of course, I didn't "see" the equal sign.

As they say "Not everyone seeing sees."

Glad you got it fixes. There's thread here on using Access:File.Open() vs
Relate:File.Open() it may bear on the Open message.

It seems your file should already be open...

Hang in there,

Ken Wagner

Quote:

> access:customer.fetch(cus:....) returns a zero if successful. Level:Benign
> equates to zero, so there is no reason why it shouldn't work. What I've done
> is the same as using CASE.

> Anyway it seems to be the clearkey line that is producing the error, not the
> fetch.

> Thanks anyway

> Bryan



> > Hi PC:

> > I think the Level:Benign returns Zero so your statement can't work. I have
> used

> > CUS:CustID = SomeVariable
> > CASE Access:Customers.Fetch(CUS:BySomeKey)
> >     OF Level:Benign
> >         Do something here.
> > END

> > Any help?

> > Ken Wagner



Mon, 17 Sep 2001 03:00:00 GMT  
 Fetch Not Working (C5EE & ABC)
Hi Bryan,



Quote:
>Now the question is, why do I have to do that. Isn't the opening of files
>handled by putting them in the FILES list?

Depends on the procedure type.  Source procedures do not open the
files (neither in ABC nor Clarion).

Best regards,

Arnor Baldvinsson        
[Team Topspeed - Internet Connect]
Allerup Edb
Denmark

Check out Icetips and Icetips Knowledgebase
http://www.icetips.com
UIN nr.: 2428601



Mon, 17 Sep 2001 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. ABC Code not working (C5EE & ABC)

2. C5EE (Clarion Chain DLL) w/ C5EE (ABC Chain DLL)

3. Disappearing Embed Points (C5EE & ABC)

4. Drop Down Combo List & C5EE (ABC)

5. Plugin2.0 - URL fetching does not work on WindowsNT

6. ABC Browse View Control not working?

7. ABC Browse Range Limits not working

8. C4: ApplyFilter method from ABC does not work

9. ABC Templates @#$%^&*&&*&*!!!!!!

10. C5EE-F ABC bug

11. Help! C5EE ABC Locator Frustration

12. fun with lines c5ee ABC

 

 
Powered by phpBB® Forum Software