Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Local View doesn't work right
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00795725
Message ID:
00796013
Vues:
13
Hi Cecil,

try

The SQL code in the local view is as follows:
=============================================
SELECT Projects.project_no, Projects.proj_name;
FROM projects;
WHERE Projects.project_no = ?m.lcProject_No


which enables you to run the view unchanged in the command
window if m.lcProject_No is defined,
and on a very large table is definitely faster.


The code in the form:
==============================================
WITH ThisForm.PgfProject.Page1
IF NOT(EMPTY(This.Value)) AND ;
(LEN(ALLTRIM(This.Value)) = ThisForm.nProjectNoLength OR ;
LEN(ALLTRIM(This.Value))= 1 )
*-- assuming projects is already open
asse ThisForm.nProjectNoLength=1 mess "ThisForm.nProjectNoLength # 1"
asse inlist(fsize("project_no", "projects"), 1, ThisForm.nProjectNoLength) ;
mess "check fieldsize"
local lcProject_No
m.lcProject_No = ALLTRIM(This.Value)
*the alltrim here feels bad!
*if project_no is a key to check against, why not reformat and query with ==
*m.lcProject_No = PadR(ALLTRIM(This.Value), fsize("project_no", "projects"))
=REQUERY("V_ProjectsPI")

===============================================================
>The =REQUERY("V_ProjectsPI") code generates the above SQL code.
Does it run the code or generate it to the dbc ?

HTH

thomas
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform