Oracle® Objects for OLE Developer's Guide 10g Release 1 (10.1) Part Number B10118-01 |
|
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