> >IF NOT TABLEUPDATE( 1, .T., '< MyAlias >' ) > IF NOT This.HandleError() > RETURN .F. >ENDIF >>
>LOCAL laErrors[1], llRetVal, loUpd, lnMsgNo >llretVal = .T. > >AERROR( laErrors ) >DO CASE >CASE laErrors[1] = 1539 && Trigger failed > DO CASE > CASE laErrors[5] = 1 && Insert Trigger > MESSAGEBOX( 'Insert Trigger Failed', 16, 'Unable to Insert Record' ) > llRetVal = .F. > CASE laErrors[5] = 2 && Update Trigger > MESSAGEBOX( 'Update Trigger Failed', 16, 'Unable to Update Record' ) > llRetVal = .F. > CASE laErrors[5] = 3 && Delete Trigger > MESSAGEBOX( 'Delete Trigger Failed', 16, 'Unable to Delete Record' ) > llRetVal = .F. > ENDCASE >CASE laErrors[1] = 1585 && Update Conflict > *** Instantiate the custom form class that displays any unresolvables > *** Update conflicts and lets the user resolve them > loUpd = CREATEOBJECT( 'updres', ThisForm.DataSessionID, .cPrimaryTable ) > IF TYPE( 'loUpd' ) = "O" AND ! ISNULL( loUpd ) > loUpd.Show() > ENDIF > llRetVal = .T. >CASE laErrors[1] = 1884 && Duplicate key > MESSAGEBOX( 'Duplicate Key', 16, 'Unable to Save Record' ) > llRetVal = .F. >OTHERWISE > MESSAGEBOX( 'Unknown Problem', 16, 'Unable to Save Record' ) > llRetVal = .F. >ENDCASE >RETURN llRetVal >>