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

EmpRefresh Subroutine

Our EmpRefresh() subroutine looks like:

Private Sub EmpRefresh()

'check if the current dynaset row is valid

If EmpDynaset.BOF <> True And EmpDynaset.EOF <> True Then

txtEmpno = EmpDynaset.Fields("empno").Value

' we can't display nulls, so display "" for NULL fields

If Not IsNull(EmpDynaset.Fields("ename").Value) Then

txtEname = EmpDynaset.Fields("ename").Value

Else

txtEname = ""

End If

If Not IsNull(EmpDynaset.Fields("job").Value) Then

txtJob = EmpDynaset.Fields("job").Value

Else

txtJob = ""

End If

'check if mgr=nul

If Not IsNull(EmpDynaset.Fields("mgr").Value) Then

txtMgr = EmpDynaset.Fields("mgr").Value

Else

txtMgr = ""

End If

If Not IsNull(EmpDynaset.Fields("hiredate").Value) Then

txtHireDate = EmpDynaset.Fields("hiredate").Value

Else

txtHireDate = ""

End If

If Not IsNull(EmpDynaset.Fields("hiredate").Value) Then

txtSal = EmpDynaset.Fields("sal").Value

Else

txtSal = ""

End If

'check if comm=nul

If Not IsNull(EmpDynaset.Fields("comm").Value) Then

txtComm = EmpDynaset.Fields("comm").Value

Else

txtComm = ""

End If

txtDeptno = EmpDynaset.Fields("deptno").Value

'if the current dynaset row is invalid, display nothing

Else

txtEmpno = ""

txtEname = ""

txtJob = ""

txtMgr = ""

txtHireDate = ""

txtSal = ""

txtComm = ""

txtDeptno = ""

End If

End Sub