Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi-user Updates to table.
Message
From
14/01/2003 11:18:40
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Multi-user Updates to table.
Miscellaneous
Thread ID:
00741486
Message ID:
00741486
Views:
61
I post peices of thsi question before but had to more on other projects and I am just getting back to this. Post here because program now runs on VFP 7. The situation is that tables live on a novell server and so does the executable. This program has been worked on by many people who are no longer here and now I am trying to understand it. What happens is that several tables are supposed to be update but sometimes a record in one of the table is not updated. Unfortunately I cannot reproduce the problem when I run the application on my pc in stand alone mode, it only seems to occur in multi-user mode (ie when updating tables on the server).

An overview of the processs.

User invokdes a form to process orders. One item on this form is a button to process recieved items. This brings up a second form. Then can either teh quantity recieved and the date they are recieved or the back order quanity recieved and the back order recieved date. Then they click on a save button. This is suppose to update two tables. Theapproricate quantity and date and date recived and a time/date stamp in the orders table and the quantity on hand and quantity on ordered in the inventory table.

My questions are:
1. is there a way of finding out what is going wrong.
2. advice on what may be wrong with the following abbreiviated code (i.e. not all calculations are shown)
lcCurOrderNo = Order_List.cordno
SELECT vitems
lcCurOrder = ORDER('vitems')
SET ORDER TO TAG ordkey IN vitems
SCAN FOR vitems.clordno = Order_List.cordno
   lcTableBckQty		= OldVal('nbackqty', 'vitems')
   lcBufferedBckQty	= vitems.nbackqty
   lnDeltaBckQty		= lcBufferedBckQty - lcTableBckQty
   lcTabledBackRec		= OldVal('dbackrec', 'vitems')
   lcBufferdBbackRec	= vitems.dbackrec
   lnDeltadBackRec		= Int(Val(Dtos(lcBufferdBbackRec))) ;
			   - Int(Val(Dtos(lcTabledBackRec)))
         More calcualtion and CASE statement
  CASE lcBufferedRecQty = 0 AND lnDeltadBackRec <> 0 
	lnOnHandQty		= lcBufferedBckQty
	lnOnOrderQty 		= lcBufferedBckQty
	llBufferedVCmpFlg	= IIF( lcBufferedBckQty = 
                                lnOrdered , .T. , .F.)
  More case statments and and other wise statement setting above to zero and .F.
  IF lnOnHandQty <> 0 && update on hand qty, on order qty, and completion flag
     RLOCK('instock')
  && make sure on order and on hand quantities are NEVER less than 0
     lnOnOrd = IIF(instock.nonord - lnOnHandQty  * lnConvFac >= 0 , ;
	instock.nonord - lnOnHandQty  * lnConvFac	, 0 )
     lnQty = IIF(instock.nqty   + lnOnOrderQty * lnConvFac >= 0 , ;
	instock.nqty   + lnOnOrderQty * lnConvFac	, 0 )
     REPLACE ;
	instock.nonord	WITH lnOnOrd, ;
	instock.nqty	WITH lnQty, ;
	instock.ddatestamp	WITH DATE(), ;
	instock.ctimestamp	WITH TIME() ;
      IN instock
     TABLEUPDATE(0,.T.,'instock') && save changes since table is buffereed
     UNLOCK IN instock			
     IF llBufferedVCmpFlg <> llTableVCmpFlg	&& update completion flag in vitems
        RLOCK('vitems')
        REPLACE vitems.lvCmpFlg WITH llBufferedVCmpFlg ;
	 IN vitems
        TABLEUPDATE(0,.T.,'vitems')	&& save changes since table is buffereed
        UNLOCK IN vitems
     ENDIF		
  ENDIF
ENDSCAN
I hope this is complete enough for suggesting solutions and where to get information am multi-user. multi-table updating.

TIA
Next
Reply
Map
View

Click here to load this message in the networking platform