Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CA blonde moment
Message
From
26/01/2016 09:34:51
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
CA blonde moment
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
SAMBA Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01630221
Message ID:
01630221
Views:
114
Hi folks.

I have a blonde moment.

How do I get a False from a TABLEUPDATE() to a CA bound cursor if ConflictCheckType is set to 0?

I allways get True, the target is not updated, GETFLDSTATE(-1) is all "1" and GETNEXTMODI(0) returns 0. The only hint for a wrong operation is _TALLY=0.

It was not a problem all those years since I refresh the data after an update conflict. But now I need to keep the data and was very surprised to find them as not touched?

What I'm doing wrong?

Example:
CLEAR ERROR
CLEAR
CREATE CURSOR x1 (P1 i, F1 L, t1 T)
INSERT INTO x1 (P1,F1) VALUES(1,.F.)

loCAP = CREATEOBJECT("Ca1")
loCAP.CURSORFILL(.F.,.F.)

SELECT x1
REPLACE F1 WITH .T.
BROWSE LAST NOWAIT

SELECT x2
REPLACE F1 WITH .T., t1 WITH DATETIME()
BROWSE LAST NOWAIT

?"ConflictChecktype = 0"
CLEAR ERROR
?"TABLEUPDATE        _TALLY        GETFLDSTATE(-1)"
?TABLEUPDATE(1,.F.,ALIAS(),laErr),_TALLY,GETFLDSTATE(-1)
DISPLAY MEMORY LIKE laErr
AERROR(laErr)
DISPLAY MEMORY LIKE laErr

?"ConflictChecktype = 1"
loCAP.CONFLICTCHECKTYPE = 1
CLEAR ERROR
REPLACE F1 WITH .T., t1 WITH DATETIME()
?TABLEUPDATE(1,.F.,ALIAS(),laErr),_TALLY,GETFLDSTATE(-1)
DISPLAY MEMORY LIKE laErr
AERROR(laErr)
DISPLAY MEMORY LIKE laErr


DEFINE CLASS Ca1 AS CURSORADAPTER
 SENDUPDATES = .T.
 ALLOWUPDATE = .T.

 ALIAS = "x2"
 SELECTCMD = "SELECT * from x1"
 TABLES = 'x1'
 KEYFIELDLIST = "P1"
 UPDATABLEFIELDLIST = "T1 F1"
 UPDATENAMELIST = "P1 x1.P1, F1 x1.F1, T1 x1.T1"
 USECURSORSCHEMA = .F.
 DATASOURCETYPE = "Native"
 WHERETYPE = 3
 BUFFERMODEOVERRIDE = 5
 CONFLICTCHECKTYPE = 0
ENDDEFINE &&Ca1 as cursoradapter
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Next
Reply
Map
View

Click here to load this message in the networking platform