Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Last Updated User
Message
 
 
À
29/03/2005 09:56:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
00988451
Message ID:
00999698
Vues:
72
Hi Gregory,

It could be my fault. I just found out, that our new database lost the table rules. E.g. the rule was not present. I'm going to put it back and re-test, may be you're right and no changes are required.

>Nadya,
>
>I'm in the middle of something, cannot look at the code right now
>
>Put this in the recordvalidation rule
>
>acti screen
>?getfldstate(-1)
>
>
>Try a replace on unbuffered
>
>You'll see
>
>____________________________________________________
>>>Nadya,
>>>
>>>A short test over here shows what I expected. It works. No need to fix anything
>>
>>It doesn't work for me. I open table and change values in fields directly. The two fields are not updated. Here is the code (yesterday I started to change it, haven't finished yet).
>>
>>
>>FUNCTION UpdateUserAndTime()
>>*  Function..........: UpdateUserAndTime
>>*  Author............: Gregory Adam thread #988451 / Nadya Nosonovsky / James Weil
>>*  Project...........: Visual Collections
>>*  Created...........: 02/02/2005  15:17:53
>>*  Copyright.........: (c) Jzanus, LTD, 2005
>>*  Major change list.:
>>
>>LOCAL lcFieldState, lnPos, lnOccurance
>>IF CURSORGETPROP("Buffering") = 1 && Table is not buffered, update status
>>	REPLACE cLast_Updated_User WITH getuserid(), tLast_Updated_Date WITH DATETIME()
>>ELSE
>>
>>	lcFieldState = SUBSTR(GETFLDSTATE(-1),2) && The first character returns deletion status
>>	lnOccurance = 1
>>
>>	lnPos = AT('2', m.lcFieldState, m.lnOccurance)
>>
>>	DO WHILE m.lnPos > 0
>>		DO CASE
>>		CASE !FieldChanged(FIELD(m.lnPos))
>>
>>&& not changed
>>		CASE INLIST(UPPER(FIELD(m.lnPos)), UPPER("cLast_Updated_User"), ;
>>				UPPER("tLast_Updated_Date"))
>>
>>&& ignore
>>		OTHERWISE
>>			REPLACE cLast_Updated_User WITH getuserid(), tLast_Updated_Date WITH DATETIME()
>>			lnPos = 0
>>		ENDCASE
>>		IF m.lnPos > 0
>>			lnOccurance = m.lnOccurance + 1
>>			lnPos = AT('2', m.lcFieldState, m.lnOccurance)
>>		ENDIF
>>	ENDDO
>>ENDIF
>>
>>ENDFUNC
>>*--------------------------------------------------------------------------
>>
>>FUNCTION FieldChanged(tcFieldName)
>>
>>LOCAL llReturn
>>
>>DO CASE
>>CASE ISNULL(OLDVAL(m.tcFieldName)) OR ISNULL(EVALUATE(m.tcFieldName))
>>	llReturn = (ISNULL(OLDVAL(m.tcFieldName)) <> ISNULL(EVALUATE(m.tcFieldName)) )
>>OTHERWISE
>>	llReturn = (OLDVAL(m.tcFieldName) <> EVALUATE(m.tcFieldName))
>>ENDCASE
>>
>>RETURN m.llReturn
>>
>>ENDFUNC
>>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform