Hi Tom,
I am glad you've found the problem.
It is important to understand that BeforeCursorFill event is called from inside of CursorFill method, but before it will do the actual work. If you try to call CursorFill from BeforeCursorFill that means that you are about to go into illegal recursion.
>My Northwind sample is listed below. The CA examples I've run across so far are way to complex ... I'm trying to build some simpler ones that demonstrate "Best Practices".
>
I am sure I've posted a number of simple examples here on UT.
Thanks,
Aleksey.
>Aleksky,
>
>I managed to get it to work by not calling CursorFill from within BeforeCursorFill.
>
>My Northwind sample is listed below. The CA examples I've run across so far are way to complex ... I'm trying to build some simpler ones that demonstrate "Best Practices".
>
>Thanks,
>
>Tom Johnson
>
>
>x=CREATEOBJECT("nwDataEnv")
>x.opentables()
>SELECT crsOrders
>BROWSE
>
>
>DEFINE CLASS OdbcCursorAdapter AS cursoradapter
> UseDeDataSource = .T.
> DataSourceType = "ODBC"
> BufferModeOverride=5
> ForceUseCursorSchema=.T. && My Property not VFPs
> BreakOnError=.T.
>
> PROCEDURE BeforeCursorFill
> LPARAMETERS luseCursorSchema, lNoDataOnLoad, cSelectCmd
> lUseCursorSchema=iif(this.ForceUseCursorSchema,.T.,lUseCursorSchema)
> ENDPROC
>
>ENDDEFINE
>
>
>
>DEFINE CLASS nwDataEnv AS dataenvironment
>
> Width = 520
> Height = 200
> DataSource = .NULL.
> DataSourceType = "ODBC"
> Name = "nwDataEnv"
>
> PROCEDURE BeforeOpenTables
> set multilocks on
> This.DataSource = sqlstringconnect([dsn=Northwind;uid=sa;trusted_connection=no])
> ENDPROC
>
> ADD OBJECT caOrders as ODBCcursoradapter WITH ;
> CursorSchema = "ORDERID I, ORDERDATE D, REQUIREDDATE T,SHIPPEDDATE T", ; && ORDERDATE NOT AS DATETIME
> Alias = "crsOrders", ;
> Name = "caOrders", ;
> paramCustomerId='TOMSP' && parameter passed to sproc
>
> PROCEDURE CaOrders.Init()
> this.SelectCmd="EXEC CustOrdersOrders ?this.paramCustomerId"
> ENDPROC
>
>ENDDEFINE
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement