Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CA blonde moment
Message
De
26/01/2016 09:34:51
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
CA blonde moment
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
SAMBA Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01630221
Message ID:
01630221
Vues:
113
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]
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform