Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: prasanna kunder
  Where is prasanna kunder?
 mumbai
 India
 prasanna kunder
 Tags
Subject: RE: how to find out CA Error
Thread ID: 373587 Message ID: 373595 # Views: 36 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Saturday, March 23, 2013 10:21:54 PM         
   


> >
> > All 13 CA methods and 23 events have an expected return value or a result parameter. Check it.
> >
> > The correct call is not
> >
oCa.Cursorfill(,,,)
.
> > It's
> >
llSuccess = oCa.CursorFill(,,) 
> > 
> > or 
> > IF oCa.CursorFill(,,)
> >   ... 
> >   ..
> > ELSE
> >   ..
> > ENDIF 

> >
> > because CursorFill( ) returns .T. or .F.
> >
> > From Help:
> > Logical data type. CursorFill returns True (.T.) if the cursor is created successfully and False (.F.) if not created successfully.
> >
> > Note
> > If CursorFill returns False (.F.), the cursor is discarded. In this case, the BeforeCursorClose Event and AfterCursorClose Event events do not occur. To retrieve error information when CursorFill returns False (.F.), you must call the AERROR( ) Function function because Visual Foxpro error handling, such as the ON ERROR command, Error event, and TRY...CATCH...FINALLY command, does not capture this error information.
> >

> >
> >
> > -Anders
>
>
>
ON ERROR DO errhand     
> IF this.tbobject.CursorFill() # .t.
>  =MESSAGEBOX("Table : "+this.tbtables,0,"CA Generated Error..")
> ENDIF 
> 
> 
> Proc ErrHand
>   = AERROR(aErrorArray)  && Data from most recent error
> 
> TEXT TO mpkErrorMesg714 NOSHOW TEXTMERGE PRETEXT 7
> 	1.  <<aErrorArray(1)>>
> 	2.  <<aErrorArray(2)>>
> 	3.  <<aErrorArray(3)>>
> 	4.  <<aErrorArray(4)>>	
> 	5.  <<aErrorArray(5)>>	
> 	6.  <<aErrorArray(6)>>
> 	7.  <<aErrorArray(7)>>	
> ENDTEXT  
>    =MESSAGEBOX(mpkErrorMesg714,0,'The error provided the following information')

>
>
> but it's doesn't show any error. Whenb CursorFill rfeturns .F., that's not a VFP error, it's a piece of information about an error.

> how to find
> thanks in advance

I guess ON ERROR doesn't happen. Not needed.
 IF this.tbobject.CursorFill() # .t.
   DO errhand
  =MESSAGEBOX("Table : "+this.tbtables,0,"CA Generated Error..")
 ELSE 
  Messagebox ('The curdsor is ok')
 ENDIF


-Anders

ENTIRE THREAD

how to find out CA Error Posted by prasanna kunder @ 3/23/2013 7:45:46 PM
RE: how to find out CA Error Posted by Borislav Borissov @ 3/23/2013 7:56:27 PM
RE: how to find out CA Error Posted by Anders Altberg @ 3/23/2013 8:01:56 PM
RE: how to find out CA Error Posted by prasanna kunder @ 3/23/2013 8:33:48 PM
RE: how to find out CA Error Posted by Anders Altberg @ 3/23/2013 10:21:54 PM