home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1996 February
/
PCWK0296.iso
/
po7_win
/
object10
/
parmoip.frm
< prev
next >
Wrap
Text File
|
1994-12-07
|
10KB
|
379 lines
VERSION 2.00
Begin Form frmEmp
BorderStyle = 3 'Fixed Double
Caption = "Emp Using Parameters"
ClientHeight = 4185
ClientLeft = 1425
ClientTop = 2160
ClientWidth = 6345
Height = 4590
Left = 1365
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4185
ScaleWidth = 6345
Top = 1815
Width = 6465
Begin CommandButton cmdFirst
Caption = "First"
Height = 495
Left = 240
TabIndex = 8
Top = 3000
Width = 1215
End
Begin CommandButton cmdLast
Caption = "Last"
Height = 495
Left = 4920
TabIndex = 11
Top = 3000
Width = 1215
End
Begin CommandButton cmdNext
Caption = "Next"
Height = 495
Left = 3600
TabIndex = 10
Top = 3000
Width = 1215
End
Begin CommandButton cmdPrevious
Caption = "Previous"
Height = 495
Left = 1560
TabIndex = 9
Top = 3000
Width = 1215
End
Begin TextBox txtComm
Height = 285
Left = 2640
TabIndex = 6
Top = 2280
Width = 1215
End
Begin TextBox txtDeptno
Height = 285
Left = 2640
TabIndex = 7
Top = 2640
Width = 1215
End
Begin TextBox txtSal
Height = 285
Left = 2640
TabIndex = 5
Top = 1920
Width = 1215
End
Begin TextBox txtHireDate
Height = 285
Left = 2640
TabIndex = 4
Top = 1560
Width = 1215
End
Begin TextBox txtMgr
Height = 285
Left = 2640
TabIndex = 3
Top = 1200
Width = 1215
End
Begin TextBox txtJob
Height = 285
Left = 2640
TabIndex = 2
Top = 840
Width = 2895
End
Begin TextBox txtEname
Height = 285
Left = 2640
TabIndex = 1
Top = 480
Width = 2895
End
Begin TextBox txtEmpno
Height = 285
Left = 2640
TabIndex = 0
Top = 120
Width = 1215
End
Begin CommandButton cmdExit
Caption = "Exit"
Height = 495
Left = 4200
TabIndex = 13
Top = 3600
Width = 1215
End
Begin CommandButton cmdQuery
Caption = "Query"
Default = -1 'True
Height = 495
Left = 840
TabIndex = 12
Top = 3600
Width = 1215
End
Begin Label Label8
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Department Number:"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 255
Left = 360
TabIndex = 21
Top = 2640
Width = 2175
End
Begin Label Label7
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Commission:"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 255
Left = 1200
TabIndex = 20
Top = 2280
Width = 1335
End
Begin Label Label6
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Salary:"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 255
Left = 1680
TabIndex = 19
Top = 1920
Width = 855
End
Begin Label Label5
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Hire Date:"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 255
Left = 1440
TabIndex = 18
Top = 1560
Width = 1095
End
Begin Label Label4
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Manager:"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 240
Left = 1560
TabIndex = 17
Top = 1200
Width = 990
End
Begin Label Label3
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Job:"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 255
Left = 2040
TabIndex = 16
Top = 840
Width = 495
End
Begin Label Label2
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Employee Name:"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 255
Left = 720
TabIndex = 15
Top = 480
Width = 1815
End
Begin Label Label1
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Employee Number:"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 255
Left = 480
TabIndex = 14
Top = 120
Width = 2055
End
End
Option Explicit
Sub cmdExit_Click ()
End
End Sub
Sub cmdFirst_Click ()
EmpDynaset.DbMoveFirst
If EmpDynaset.BOF = True Then
MsgBox WarnFirstEmp$
EmpDynaset.DbMoveFirst
End If
Call EmpRefresh
End Sub
Sub cmdLast_Click ()
EmpDynaset.DbMoveLast
If EmpDynaset.EOF = True Then
MsgBox WarnLastEmp$
EmpDynaset.DbMoveLast
End If
Call EmpRefresh
End Sub
Sub cmdNext_Click ()
If EmpDynaset.EOF <> True Then
EmpDynaset.DbMoveNext
If EmpDynaset.EOF = True Then
MsgBox WarnLastEmp$
EmpDynaset.DbMoveLast
End If
End If
Call EmpRefresh
End Sub
Sub cmdPrevious_Click ()
If EmpDynaset.BOF <> True Then
EmpDynaset.DbMovePrevious
If EmpDynaset.BOF = True Then
MsgBox WarnFirstEmp$
EmpDynaset.DbMoveFirst
End If
End If
Call EmpRefresh
End Sub
Sub cmdQuery_Click ()
Dim var As Variant
var = txtJob
OraDatabase.Parameters("job").value = var
EmpDynaset.DbRefresh
Call EmpRefresh
End Sub
Sub EmpRefresh ()
If EmpDynaset.BOF <> True And EmpDynaset.EOF <> True Then
txtEmpno = EmpDynaset.Fields("empno").value
txtEname = EmpDynaset.Fields("ename").value
txtJob = EmpDynaset.Fields("job").value
'check if mgr=nul
If Not IsNull(EmpDynaset.Fields("mgr").value) Then
txtMgr = EmpDynaset.Fields("mgr").value
Else
txtMgr = ""
End If
txtHireDate = EmpDynaset.Fields("hiredate").value
txtSal = EmpDynaset.Fields("sal").value
'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
Else
txtEmpno = ""
txtEname = ""
txtJob = ""
txtMgr = ""
txtHireDate = ""
txtSal = ""
txtComm = ""
txtDeptno = ""
End If
End Sub
Sub Form_Load ()
'OraSession and OraDatabase are global
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.OpenDatabase(DatabaseName$, Connect$, 0&)
OraDatabase.Parameters.Add "job", "MANAGER", 1
txtJob = "MANAGER"
Set EmpDynaset = OraDatabase.DbCreateDynaset(EmpQuery$, 0&)
Call EmpRefresh
End Sub