Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random Failure to update a table
Message
 
To
16/05/2002 09:43:59
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00657390
Message ID:
00659253
Views:
28
>The problem is that occasionally the 1st record of a multiple record update
>is not updated. I need to force the update. Tables are on a server via

Hmmm....
I don't think it is a Novell Problem

Some Ideas:

1. Did you check if the replace really does what it
should?
Have a look in the documentation. I think it says
that replace will fail if the currently selected
table is EOF(). You are replacing in , so
maybe You're standing actually somere in the "nowhere".
I think it's more save to do

select INVENTORY
replace xy with za

instead of
replace xy with za in INVENTORY


2. What is the buffering 3 or 5?
Tableupdate() in some circumstances
actually moves the record-pointer. So
Your scan may fail.
You could set it to 5 and do the table
update after the scan. Additionally You
could put this all in a Transaction.
Something like this
select INVENTORY

set database to <MyDataBase>

=CursorSetprop("buffering", 5, "INVENTORY")
select INVENTORY
scan
    ...

    replace ....  
 

endscan

begin transaction
ll_OK = TableUpdate(1,.F., "INVENTORY")

if ll_OK
  END TRANSACTION
  wait window "Successfully saved" time 2
else
  ROLLBACK
  wait window "Ooops... something went wrong" 
  =tableRevert(.T., "INVENTORY")
endif
You can call TableUpdate() with additional Parameters
and thus save the failed records to an array -> documentation
and so decide more specific, what to do

3. When You scan a table where an index is
set on the field You are updating, the scan
might (will) also create unpredictable results
as the pointer wildly jumps around

4. If You are locking the record, You do not need
the buffering, as You already have the record. (at
least not the way You are using it)

Hope theese hints help a little.
Regards from Berlin

Frank

Dietrich Datentechnik (Berlin)
Softwarekombinat Teltow (Teltow)

Frank.Dietrich@dd-tech.de
DFPUG # 327
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform