Skip Headers

Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)

Part Number B10118-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

Commit_Click() Event Procedure

Private Sub Commit_Click()

Dim DupDyn As Object

Dim DupDynQry As String

On Error GoTo err_commit

ErrMsg = ""

'Do validation checks on entered data

If DoValidationChecks Then 'If validation checks have passed

'If we are adding a record use DbAddNew

If DoAdd = True Then

EmpDynaset.AddNew

End If

'If we are updating a record use DbEdit

If DoUpdate = True Then

EmpDynaset.Edit

End If

'Update the dynaset fields and then update database if there is

'no error.

If UpdateDynasetFields Then

EmpDynaset.Update

End If

SetAfterCommitFlags

End If 'Endif for DoValidationChecks

Exit Sub

err_commit:

If ErrMsg <> "" Then

MsgBox ErrMsg

Else

MsgBox Error$

End If

End Sub