Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi-user Updates to table.
Message
From
15/01/2003 17:28:38
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
 
To
15/01/2003 08:41:56
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00741486
Message ID:
00742148
Views:
25
>>The most obvious problem (IMO), is that there is no "error-handling"; ie. there is no testing of return codes from RLOCK() or TABLEUPDATE() which would indicate whether or not an operation was successfull or not.
>
>I did NOT write, but I need to fix it.
>
>Can you please give me some pointers on what needs to be changed, i.e either code snippets or where to get the information on the necessary error checking and anthing else I need to do.

I would just add some "defensive programming" to start with.

Instead of simply RLOCK(..), code an IF .. ELSE ... eg.
IF !RLOCK(..)
   = MESSAGEBOX( "Record in use. Please try again" )
   RETURN
ENDIF
...
IF !TABLEUPDATE(..)
   ... some error processing ...
   RETURN
ENDIF
Look up RLOCK(), TABLEUPDATE() and AERRORS() in Help for more information.

Taking it one step at a time avoids being overwhelmed. If you provide some feedback to the User on why an update failed, then they can then help you with the problem. You might even add a temporary "record updated" success MESSAGEBOX if it helps to assure you that the "transaction update" code is actually being executed.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform