Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't update the &%!#@ field
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00051833
Message ID:
00052161
Views:
40
>>>I just changed the code to select before the replace. No help. I know that in other places in my app I replace in other work areas all the time, so I experimented in the command window just to be sure:
>>>
>>>USE table1 in 0
>>>USE table2 in 0
>>>sele table 1
>>>replace table2.field1 with "ZZZZZ"
>>>
>>>This works fine. The table gets updated no problem.
>>
>>The tricky thing about replacing into another work area is that most of the time it will work. When it fails it generates no error message. The problem occurs if table1 is at EOF. The replace will fail in this case. The safe way to do a replace is select the table first. In VFP you also have another option, add the IN TableAlias clause to the replace (REPLACE Field1 WITH "ZZZZ" IN Table2).
>
>I just tried the scenario and it fails sure enough! That is WIERD!!!
>I went back to my problem procedure and added the select again. (-Edward- I had added it in the wrong place before):
>
>locate for join_cancel.jmembnum = currentmember;
>and join_cancel.activity = "JOIN";
>and join_cancel.jdate > currentjdate;
>and deleted() = .F.
>
>sele memb
>
>if !found() then
> replace memb.orig with currentjdate
>endif
>
>Where it needed to be inside the 2nd if statement (Found() gets reset when switching Work areas)
>
>Thanks for your help, guys, I would have NEVER figured that out.


Eric
It may help if you would quit calling your fields &%!#@.
Just a thought !!!
Hope things are going well and it looks like the guys have you covered.

Jeff Butler

It's Time to get a gun.

That's what I've been thinkin.

I think I can afford one, If I do a little less Drinkin.

www.TrueGeeks.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform