Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CA variable WHERE (CursorRefresh & CursorFill)
Message
De
19/03/2003 14:48:16
 
 
À
19/03/2003 06:35:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00767433
Message ID:
00767769
Vues:
9
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform