Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using thisform.SomeProperty in SQL calls?
Message
De
29/06/2009 12:21:36
 
 
À
29/06/2009 12:12:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01409097
Message ID:
01409099
Vues:
54
What about
lcSQL = "SELECT " + this.cLookupField + " FROM " + this.cLookupAlias + " WHERE " + this.cLookupAlias + " = " + tcLookup + " INTO ARRAY lalookup"
&lcSQL
>I seem to recall having problems in the past trying to use "Thisform.Whatever" property references in certain places in a SQL call, so, now I tend to do this tecnique to get the form properties into local vars and then using the local vars in the SQL:
>lcLookupTable=this.cLookupAlias
>lcLookupField=this.cLookupField
>lcWhereClause= lcLookupTable + '=' + tcLookup
>
>Select &lcLookupField From &lcLookupTable Where &lcWhereClause Into Array laLookup
>Is this the best practice, or can I just directly reference the form properties in a SQL?
>
>Something like this...
>Select (thisform.cLookupField) From (thisform.cLookupAlias) where (thisform.cLookupField)=tcLookup Into Array laLookup
>That just looks like it won't even work. But it would keep me from creating all those local vars.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform