pfc_dberror


pfcmain.pbl   >   pfc_w_master   >   pfc_dberror   

Full name pfc_w_master.pfc_dberror
Access public
Extend of
Return value
Prototype event pfc_dberror()

Name Datatype
No Data

Name Datatype
lnv_dberrorattrib n_cst_dberrorattrib
ls_msgparm string[1]

event pfc_dberror;//////////////////////////////////////////////////////////////////////////////
//
//	Event:  pfc_dberror
//
//	Arguments:	None	
//
//	Returns:  integer
//	 1 = success
//	-1 = error
//
//	Description:
//	Display the dberror that was encountered during the pfc_save process.
//
// Note: Triggered by the pfc_save when the update failed, after the appropriate
//		end transaction process (which if appropriate should include rollback process)
//
//////////////////////////////////////////////////////////////////////////////
//	
//	Revision History
//
//	Version
// 5.0.02 Initial version	
// 6.0 	Enhanced to use dberrorattrib.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1997 Sybase, Inc. and its subsidiaries.  All rights reserved.
//	Any distribution of the PowerBuilder Foundation Classes (PFC)
//	source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////

string	ls_msgparm[1]
n_cst_dberrorattrib lnv_dberrorattrib

// Get the error message.  First check on the dberrorattrib.  If not found there,
// get it from is_dberrormsg (backward compatibility code).
If IsValid(inv_dberrorattrib) Then
	If Len(Trim(inv_dberrorattrib.is_errormsg)) > 0 Then
		ls_msgparm[1] = inv_dberrorattrib.is_errormsg
	Else
		ls_msgparm[1] = is_dberrormsg
	End If
Else
	ls_msgparm[1] = is_dberrormsg
End If

// Display the error message (it was suppressed until after the end transaction process).
If IsValid(gnv_app.inv_error) Then
	gnv_app.inv_error.of_Message ('pfc_dwdberror', ls_msgparm, &
				gnv_app.iapp_object.DisplayName)				
Else
	of_Messagebox ('pfc_master_dwdberror', gnv_app.iapp_object.DisplayName, &
		ls_msgparm[1], StopSign!, Ok!, 1)
End If

// Clear the error message variable.
of_SetDBErrorMsg(lnv_dberrorattrib)
end event

     
Name Owner
pfc_w_master.pfc_save pfc_w_master

     
Name Owner
systemfunctions.isvalid systemfunctions
systemfunctions.len systemfunctions
systemfunctions.trim systemfunctions
pfc_n_cst_error.of_message pfc_n_cst_error
pfc_w_master.of_messagebox pfc_w_master
pfc_w_master.of_setdberrormsg pfc_w_master

     
Full name
demopfc

     
Name Scope
No Data