>I do an update with set
>
>
>UPDATE MyView ;
> SET ;
> Field1 = nValue1, ;
> Field2 = .nSomeValueIHave ;
> WHERE code = nValue3
>
>this gives an error even if there is a WITH in the beginning of that procedure
>
>
>UPDATE MyView ;
> SET ;
> Field1 = nValue1, ;
> Field2 = thisform.nSomeValueIHave ;
> WHERE code = nValue3
>
>doesn't give an error
>
>
>What's wrong here?
It's a limitation of the UPDATE - SQL command - it doesn't accept object properties. From VFP help:
"If you want to use an object property in an expression, you need to specify a memory variable and then use that variable in the expression. For example, you can specify x = oColField("iid").Value and then use the SET clause set iid = x in your UPDATE - SQL command. If you use the object property, that is objectname.property, directly in the expression, the command uses it as an alias and fails."
Are you sure your second code sample actually works, and gives the results you expect (i.e. doesn't fail silently)? If so, that might be an interesting exception to the limitation pointed out in the help.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up