Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UPDATE-SQL and properties
Message
De
30/08/2003 18:50:39
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
30/08/2003 18:45:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00824869
Message ID:
00824870
Vues:
12
>UPDATE-SQL doesn't seem to work with properties. For example, the following creates an error that TEXTLASTNAME isn't found.
>
>
LOCAL oPage as object, iIndex as Integer
>
>oPage = ThisForm.PFrame1.Page1
>iIndex = 45
>
>UPDATE MyTable ;
>   SET MyField = oPage.TextLastName.Value ;
>   WHERE MyIndex = iIndex
>
>However the REPLACE command does work as follows.
>
LOCAL oPage as object, iIndex as Integer
>
>oPage = ThisForm.PFrame1.Page1
>iIndex = 45
>
>SELECT MyTable
>REPLACE MyField WITH oPage.TextLastName.Value ;
>   FOR MyIndex = iIndex
>
>I have noticed this in all of VFP 6/7/8. I know I can make local variables from the object properties and it works, but that seems a kludge. Is there some other way around this to get UPDATE-SQL to work?
>
>Thanks in advance,
>David

Actually, there are several places where you need variables, not properties.

You might try alternatives, like enclosing ThisForm....Property in parentheses (I don't have VFP here right now, to test this out), but in general, be prepared to use variables in some special cases.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform