Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql select involving form control values
Message
De
12/03/2012 11:47:48
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
12/03/2012 07:40:28
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
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 6 SP3
OS:
Windows XP
Network:
Windows 2003 Server
Divers
Thread ID:
01537910
Message ID:
01538063
Vues:
56
>>Thank you again Hilmar. Its good that you also realized that trying to use something like ThisForm.Text1.Value as part of the FIELDS selection in an SQL does not work. However, if used in the WHERE clause. How amazing !!!. I still have a feeling that it should work but may be needs some conversion or enclosure into something. Other Gurus can probably help us on this
>>
>>Fred Kotte
>
>For the field selection, I tried to select the fields both as (ThisForm.Text1.Value), i.e. with parentheses, and combining it in a larger expression, as in 0 + ThisForm.Text1.Value. In both cases Visual FoxPro seems to interpret it, incorrectly, as a table.
>
>On the other hand, I don't see much of a problem using a variable to get user input.

I usually bind the control to a form's property, and when using it in a select I assign it to a variable. I think the main thing here is to have no dots in the expression used inside the SQL statements, so the parser doesn't find anything looking like an alias where there isn't one.

So...
lcValue=thisform.cValue

select ?lcValue as SomeField, ... from ...

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform