Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update Conflict Error Message
Message
From
26/05/2005 13:18:29
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Update Conflict Error Message
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01017883
Message ID:
01017883
Views:
50
The 1st time a user has the record lock on a table, the other users are getting the message "Record is Lock in used by another". Did is what I want to appear.

The 2nd time when the user is using the same record, I get the "Update Conflict Error Message"

Here is the code that I am using. I am getting the error on the
SEEK lcPVL IN Lots
*****************************************************************************
SET ORDER TO PINVACLot IN lots
lcPVL = dlot.Pin + dlot.vaccine + dlot.Lot
SEEK lcPVL IN Lots
IF FOUND()
	gcLotNumber = DLot.Lot
ENDIF

IF FOUND() AND RLOCK()
	IF distrib.Lot = 'NOT RECEIVED'
		REPLACE Distrib.Shipped WITH 0
		REPLACE Lots.SIZE WITH DLot.SIZE
		IF LOWER(THISFORM.NAME) = 'frmdistribution'
			THISFORM.chkShipped.ENABLED = .F.
		ENDIF
		THISFORM.txtShortName.CONTROLSOURCE = 'DLot.Maker'
		THISFORM.txtSize.CONTROLSOURCE = 'DLot.Size'
	ELSE
		THISFORM.txtShortName.CONTROLSOURCE = 'Lots.Maker'
		THISFORM.txtSize.CONTROLSOURCE = 'Lots.Size'
		IF LOWER(THISFORM.NAME) = "frmdistribution" AND thisform.editmode
			THISFORM.chkShipped.ENABLED = .T.
		ENDIF
	ENDIF

	IF thisform.editmode 
		SET ORDER TO PINVACLot IN lots
		lcPVL = dlot.Pin + dlot.vaccine + dlot.Lot
		SEEK lcPVL IN Lots
		THISFORM.txtShortName.REFRESH()
		THISFORM.txtSize.REFRESH()
		THISFORM.txtDoses_Available.REFRESH()
		SET ORDER TO lot IN lots
	ELSE
		SELECT Lots
	ENDIF 

	IF LOWER(THISFORM.NAME) = 'frmdistribution'
		THISFORM.txtExpiry.REFRESH()
	ENDIF

	SELECT Distrib

	IF !EMPTY(Distrib.PIN) AND !EMPTY(Distrib.FromPIN) AND LOWER(THISFORM.NAME) = "frmdistribution"
		THISFORM.cmdAllow.ENABLED = .T.
	ENDIF

	THISFORM.spnDoses.KEYBOARDLOWVALUE = 0
	THISFORM.spnDoses.SPINNERLOWVALUE = 0

	IF Lots.SIZE > 0
		IF Distrib.Doses < Lots.SIZE
			REPLACE Distrib.Doses WITH Lots.SIZE
		ELSE
			REPLACE Distrib.Doses WITH INT(Distrib.Doses /Lots.SIZE) * Lots.SIZE
		ENDIF
	ENDIF

	IF THIS.STYLE = 2
		THIS.STYLE = 0
	ENDIF
	
	SELECT Lots
	
	SELECT(lcAlias)

	RETURN 1
ELSE
	IF gnAnswer != 2
		gnAnswer = MESSAGEBOX("Record is being modified PLEASE TRY LATER!",37,"ALERT")
	ENDIF		
	
	IF gnAnswer = 4
		SELECT(lcAlias)
		gnAnswer = 0
		RETURN 0
	ELSE
		SELECT(lcAlias)
		RETURN 1
	ENDIF
ENDIF
*****************************************************************************
All suggestion will be appreicated in resolving this problem.



Thank You In Advance



Winfred Majors
Next
Reply
Map
View

Click here to load this message in the networking platform