Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conflict update in cursor

Status
Not open for further replies.

sashaDG

Programmer
Jun 20, 2022
112
0
16
BY
Hi all! There is a table when you click on the edit button, buffering is =CURSORSETPROP("Buffering", 3)

This happens when =CURSORSETPROP("Buffering", 1) is commented out, when uncommented: I get the error [highlight #FCE94F]"There is no ) in the name of the function"[/highlight]. The table has "stop" "continue". When I click "Continue" a table appears "Operator and operand type mismatch" and "Stop" "Continue". And when I click "Continue" everything is OK, both applications continue to work and the last change is [highlight #FCE94F]displayed[/highlight] on another application.

When saving, buffering is set to =CURSORSETPROP("Buffering", 1) (I don’t know if this is necessary, I’m doing it from an example). If it is needed,then i should insert =CURSORSETPROP("Buffering", 1) on the cancel edit button.

I am building an application. Everything works well until the moment when editing starts from two applications of the same record. ERROR [highlight #FCE94F]"Conflict update in cursor"[/highlight]

I found a similar discussion but i try to handle error 1585 but not working even though i have OTHERWISE, but it doesnt work PROCEDURE ERRORHND
Code:
		CASE ERRORCODE = 1585
		LOCAL lnMsgResult
			lnMsgResult = ;
				MESSAGEBOX('While you were making adjustments, +;
 'Someone already changed this entry. ' +;
 'Will you overwrite your changes?', 20, 'Attention!')
			IF lnMsgResult = 6
				= TABLEUPDATE(.T., .T.)
			ELSE
				= TABLEREVERT()
				ENDIF
		CASE ERRORCODE = 1961
			WAIT 'OK' WINDOW NOWAIT
		OTHERWISE
			lnMsgResult = MESSAGEBOX('Error code ' + STR(ERRORCODE,4)+CHR(13)+;
 MESSAGE() + [ ] + MESSAGE([1]) + CHR(13)+;
 'Abort? ',20,' Error found ')
			IF lnMsgResult = 6
				DO STOP
			ENDIF

I suppose PROCEDURE ERRORHND does not work for me in the built application
 
Guys, I figured out the messagebox breaking should not have been done when I wrote it down in one line it all worked. Thanks to all))

MESSAGEBOX('While you were making adjustments, Someone already changed this entry. Will you overwrite your changes?', 20, 'Attention!')

 
Several points to address here.

"There is no ) in the name of the function"

Well, that presumably means exactly what it says. But we can't be sure without seeing the actual code that caused the error (which, by the way, is not a standard VFP error message).

The table has "stop" "continue".

Your post would make more sense if you used the word dialogue rather than table.

I suppose PROCEDURE ERRORHND does not work

The normal way to establish an error-handler is with an ON ERROR statement. Is that what you are doing?

"Conflict update in cursor"

This is not a standard VFP error message, so we would need to see the code that causes it to happen.

I don’t know if this is necessary, I’m doing it from an example

I think this is the root of your problem. There's nothing wrong with looking for examples on the internet and elsewhere. On the contrary, it's often a useful thing to do. But it is a mistake to simply copy and paste code that you find somewhere and expect it to work in your application. It's much better to read the code and understand the theory behind it, and then to apply what you learn to your own work.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Sasha,

It hasn't anything to do with the breaking of the MESSAGEBOX text. You simply forgot to put a paired number of quotation marks.

Code:
CASE ERRORCODE = 1585
		LOCAL lnMsgResult
			lnMsgResult = ;
				MESSAGEBOX('While you were making adjustments,[b][highlight #EF2929]'[/highlight][/b] + ;
 'Someone already changed this entry. ' + ;
 'Will you overwrite your changes?', 20, 'Attention!')

hth

MarK
 
I just want to add that I don't think it's common to turn buffering on and off within the form. I think most people either have tables buffered all the time or turn buffering on when the form opens and off when the form closes.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top