Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter and WHERE
Message
 
À
21/02/2008 13:29:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01294821
Message ID:
01294934
Vues:
31
This message has been marked as the solution to the initial question of the thread.
It looks like your code should work but it failed for me also.

I was able to get the concept to work using BeforeCursorFill event. Setting the cSelectCmd mem var and returning .T. worked when I tested it.
LPARAMETERS luseCursorSchema, lNoDataOnLoad, cSelectCmd

LOCAL lc_where as String

IF LEN(ALLTRIM((THIS.c_where_clause))) > 0
	lc_where = " WHERE " + THIS.c_where_clause
ELSE
	lc_where = SPACE(0)
ENDIF

THIS.c_select_cmd = THIS.SelectCmd


TEXT TO m.cSelectCmd TEXTMERGE NOSHOW FLAGS 0 PRETEXT 1+2+4+8
	<<THIS.SelectCmd>> <<lc_where>>
ENDTEXT

RETURN .T.
>Hi Patrick --
>
>Yes, I initially started with code to build the WHERE clause in the BeforeCursorFill event. I noted that this code was NOT being executed as I thought it would be and placed the code into the CursorFill as:
>
>
>LPARAMETERS luseCursorSchema, lNoData, nOptions, Source
>
>LOCAL ;
>	lc_where as String, ;
>	lv_result as Variant
>
>IF (( NOT EMPTY(THIS.c_where_clause) ))
>	lc_where = " WHERE " + THIS.c_where_clause
>ELSE
>	lc_where = SPACE(0)
>ENDIF
>
>THIS.c_select_cmd = THIS.SelectCmd && Save our default Select Command
>
>TEXT TO THIS.SelectCmd TEXTMERGE NOSHOW FLAGS 0 PRETEXT 1+2+4+8
>	<<THIS.SelectCmd>> <<lc_where>>
>ENDTEXT
>
>lv_result = DODEFAULT(luseCursorSchema, lNoData, nOptions, Source)
>
>THIS.SelectCmd = THIS.c_select_cmd && Return to our default Select Command
>
>
>RETURN lv_result
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform