Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't get ODBC cursoradapter to use Cursor Schema
Message
From
15/08/2003 14:25:00
 
 
To
15/08/2003 13:37:28
Tom Johnson
Plymouth Rock Technology, Inc.
Plymouth, Massachusetts, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00820329
Message ID:
00820613
Views:
16
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform