Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CA variable WHERE (CursorRefresh & CursorFill)
Message
From
19/03/2003 14:48:16
 
 
To
19/03/2003 06:35:07
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00767433
Message ID:
00767769
Views:
11
Hi Michael,

>But if cursor binded to a Grid, after CursorFill it unbinded.
>How can i use CursorRefresh?
>Any ideas?

There is a way to use parameters in SelectCmd, parameters are reevaluated during REQUERY and CursorRefresh.
CLOSE DATABASES all
CLEAR 
SET MULTILOCKS ON

CREATE CURSOR foo (f1 I)
INSERT INTO foo VALUES (1)
INSERT INTO foo VALUES (2)

LOCAL oCA as CursorAdapter
oCA = CREATEOBJECT("CursorAdapter")
oCA.DataSourceType="NATIVE"

? "try with macro"
lcSQLWhere = "f1 = 1"
oCA.SelectCmd="SELECT * FROM foo WHERE &?lcSQLWhere"
?[oCA.SelectCmd],oCA.SelectCmd
?[oCA.CursorFill()],oCA.CursorFill()
SELECT (oCA.Alias)
LIST

lcSQLWhere = "f1 = 2"
?[REQUERY()],REQUERY()
LIST

? "try with parameter with '?'"
nF1=1
oCA.SelectCmd="SELECT * FROM foo WHERE f1=?nF1" && will prompt for parameter if it can not be found
?[oCA.SelectCmd],oCA.SelectCmd
?[oCA.CursorFill()],oCA.CursorFill()
SELECT (oCA.Alias)
LIST

nF1=2
?[REQUERY()],REQUERY()
LIST

? "try with parameter without '?'"
nF1=1
oCA.SelectCmd="SELECT * FROM foo WHERE f1=nF1" && will not prompt for parameter if it can not be found
?[oCA.SelectCmd],oCA.SelectCmd
?[oCA.CursorFill()],oCA.CursorFill()
SELECT (oCA.Alias)
LIST

nF1=2
?[REQUERY()],REQUERY()
LIST
Thanks,
Aleksey.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform