Article ID: 142284
Article Last Modified on 7/13/2004
Error Number: tnError - ERROR()
Error Message: tcMessage - MESSAGE()
line of code that caused the error: tcCode - MESSAGE(1)
program name in which the error occurred: tcProgram - PROGRAM()
",FORM1.COMMAND1.CLICK,__RI_INSERT_ParentTable,RIERROR".The gaErrors[] array also holds the following information:
Parent Table's Name - pcParentDBF
current record of the Parent Table when the error occurred - pnParentRec
Parent's Primary Key value at the time of the error - pcParentID
The Field name the Primary Key index is based on - pcParentExpr
Child Table's Name - pcChildDBF
current record of the Child Table when the error occurred - pnChildRec
Child's Primary Key value at the time of the error - pcChildID
The Field name the Primary Key index is based on - pcChildExpr
IF .NOT. TABLEUPDATE(.T.,.T.)
=TABLEREVERT(.T.) &&Revert the change
IF TYPE('gaErrors[1,1]') <> 'L'
=MESSAGEBOX('Trigger Failed - '+gaErrors[1,2],0,;
'Data Entry Error/Trigger Failed')
ENDIF
GO TOP
ENDIF
THISFORM.REFRESH
The array gaErrors[] can be seen by setting up some Referential Integrity
Rules with the RI Builder and then performing some operation on those
tables that would violate the rules. After the operation fails, type the
following commands in the Command window:
_SCREEN.SHOW() DISPLAY MEMORY LIKE gaErrors
Keywords: kbhowto kbcode KB142284