Discussion:
Tableupdate() problem
(too old to reply)
Sorin Sandu
2004-09-06 10:43:25 UTC
Permalink
When I issue =TABLEUPDATE(0,.T.,"tablename") my changes are not commited.
I have Optimistic Buffering at form level against a remote view.
What things do I have to check ?
When I call =TABLEUPDATE(1,.T.,"amortizate") it's working.
Stefan Wuebbe
2004-09-06 11:19:06 UTC
Permalink
You may want to check the return value of TableUpdate() anyway.
When its .F. you can use AERROR() to get the reason.
AERROR(aErrors)
DO CASE
CASE aErrors[1,1] = 1585 && Record changed by another user
MessageBox(... && etc.


hth
-Stefan
Post by Sorin Sandu
When I issue =TABLEUPDATE(0,.T.,"tablename") my changes are not commited.
I have Optimistic Buffering at form level against a remote view.
What things do I have to check ?
When I call =TABLEUPDATE(1,.T.,"amortizate") it's working.
Sorin Sandu
2004-09-06 12:09:11 UTC
Permalink
Yes I have:
Table buffer for alias "name" contains uncommitted changes (Error 1545)
How can I resolve this ???
Post by Stefan Wuebbe
You may want to check the return value of TableUpdate() anyway.
When its .F. you can use AERROR() to get the reason.
AERROR(aErrors)
DO CASE
CASE aErrors[1,1] = 1585 && Record changed by another user
MessageBox(... && etc.
hth
-Stefan
Post by Sorin Sandu
When I issue =TABLEUPDATE(0,.T.,"tablename") my changes are not commited.
I have Optimistic Buffering at form level against a remote view.
What things do I have to check ?
When I call =TABLEUPDATE(1,.T.,"amortizate") it's working.
Stefan Wuebbe
2004-09-07 04:51:54 UTC
Permalink
You don't get error 1545 during the TableUpdate() but on a
subsequent Requery() , right?

IOW, this example might through an error because it does not
care if the update succeeds or not
TABLEUPDATE(0,.T., "customerView")
REQUERY("customerView")

This would be better
IF TABLEUPDATE(0,.T., "customerView") && = .T.
REQUERY("customerView")
ELSE
&& have a look why the update failed:
AERROR(aErrors)
DO CASE
&& etc.
ENDIF


hth
-Stefan
Post by Sorin Sandu
Table buffer for alias "name" contains uncommitted changes (Error 1545)
How can I resolve this ???
Post by Stefan Wuebbe
You may want to check the return value of TableUpdate() anyway.
When its .F. you can use AERROR() to get the reason.
AERROR(aErrors)
DO CASE
CASE aErrors[1,1] = 1585 && Record changed by another user
MessageBox(... && etc.
hth
-Stefan
Post by Sorin Sandu
When I issue =TABLEUPDATE(0,.T.,"tablename") my changes are not commited.
I have Optimistic Buffering at form level against a remote view.
What things do I have to check ?
When I call =TABLEUPDATE(1,.T.,"amortizate") it's working.
Sorin Sandu
2004-09-07 05:16:57 UTC
Permalink
Yes I found that but how can I avoid this error ?
Why Tableupdate() doesn't do the job correctly ???
I will try an Update first.
Post by Stefan Wuebbe
You don't get error 1545 during the TableUpdate() but on a
subsequent Requery() , right?
IOW, this example might through an error because it does not
care if the update succeeds or not
TABLEUPDATE(0,.T., "customerView")
REQUERY("customerView")
This would be better
IF TABLEUPDATE(0,.T., "customerView") && = .T.
REQUERY("customerView")
ELSE
AERROR(aErrors)
DO CASE
&& etc.
ENDIF
hth
-Stefan
Post by Sorin Sandu
Table buffer for alias "name" contains uncommitted changes (Error 1545)
How can I resolve this ???
Post by Stefan Wuebbe
You may want to check the return value of TableUpdate() anyway.
When its .F. you can use AERROR() to get the reason.
AERROR(aErrors)
DO CASE
CASE aErrors[1,1] = 1585 && Record changed by another user
MessageBox(... && etc.
hth
-Stefan
Post by Sorin Sandu
When I issue =TABLEUPDATE(0,.T.,"tablename") my changes are not commited.
I have Optimistic Buffering at form level against a remote view.
What things do I have to check ?
When I call =TABLEUPDATE(1,.T.,"amortizate") it's working.
Stefan Wuebbe
2004-09-07 06:36:31 UTC
Permalink
Post by Sorin Sandu
Yes I found that but how can I avoid this error ?
Why Tableupdate() doesn't do the job correctly ???
It does what you told it to do.
You chose 0 / .F. as TableUpdate's first parameter, which can
make perfect sense, but is the opposite of a "forced" update.
It literally means something like: try to update politely, but don't
overwrite other users' modifications in a multi-user scenario
Post by Sorin Sandu
Post by Sorin Sandu
When I call =TABLEUPDATE(1,.T.,"amortizate") it's working.
hth
-Stefan

Loading...