Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update or Replace?
Message
De
29/05/2003 07:45:33
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
29/05/2003 07:37:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00793862
Message ID:
00793864
Vues:
42
This message has been marked as the solution to the initial question of the thread.
>When I use next operator VFP6:
>
>UPDATE mytable SET name1=This.parent.Text1.value, .... when ...
>in Command1.click method I have an error
>
>Text1 alias not found.
>
>I must use Locate and Replace operators?
>Or it is more way to use Update-SQL operator?
>PS. Insert-SQL operator working with This...-construction.
>Thanks.

Sergey,
It's a known behaviour with SQL update. It gets the first reference as an 'alias'. ie:

update myTable set myField = thisform.myProperty

Would work using 'thisform' as an 'alias'. But this one doesn't :

update myTable set myField = thisform.myObj.myProperty

IOW you need alias.fieldname style.

In order to use Uppdate SQL in your sample above you'd need variables :
local lcName
lcName = This.parent.Text1.value
UPDATE mytable SET name1=lcName, .... where ...
PS: This would also work :
UPDATE mytable SET name1=eval('This.parent.Text1.value'), .... where ...
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform