home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / po7_win / object10 / empoip.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-11-20  |  9.0 KB  |  311 lines

  1. VERSION 2.00
  2. Begin Form frmOIP 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Employee Form"
  5.    ClientHeight    =   3585
  6.    ClientLeft      =   2055
  7.    ClientTop       =   2310
  8.    ClientWidth     =   6345
  9.    Height          =   4275
  10.    Left            =   1995
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   3585
  13.    ScaleWidth      =   6345
  14.    Top             =   1680
  15.    Width           =   6465
  16.    Begin CommandButton cmdFirst 
  17.       Caption         =   "First"
  18.       Height          =   495
  19.       Left            =   240
  20.       TabIndex        =   8
  21.       Top             =   3000
  22.       Width           =   1215
  23.    End
  24.    Begin CommandButton cmdLast 
  25.       Caption         =   "Last"
  26.       Height          =   495
  27.       Left            =   4920
  28.       TabIndex        =   11
  29.       Top             =   3000
  30.       Width           =   1215
  31.    End
  32.    Begin CommandButton cmdNext 
  33.       Caption         =   "Next"
  34.       Height          =   495
  35.       Left            =   3600
  36.       TabIndex        =   10
  37.       Top             =   3000
  38.       Width           =   1215
  39.    End
  40.    Begin CommandButton cmdPrevious 
  41.       Caption         =   "Previous"
  42.       Height          =   495
  43.       Left            =   1560
  44.       TabIndex        =   9
  45.       Top             =   3000
  46.       Width           =   1215
  47.    End
  48.    Begin TextBox txtComm 
  49.       Height          =   285
  50.       Left            =   2640
  51.       TabIndex        =   6
  52.       Top             =   2280
  53.       Width           =   1215
  54.    End
  55.    Begin TextBox txtDeptno 
  56.       Height          =   285
  57.       Left            =   2640
  58.       TabIndex        =   7
  59.       Top             =   2640
  60.       Width           =   1215
  61.    End
  62.    Begin TextBox txtSal 
  63.       Height          =   285
  64.       Left            =   2640
  65.       TabIndex        =   5
  66.       Top             =   1920
  67.       Width           =   1215
  68.    End
  69.    Begin TextBox txtHireDate 
  70.       Height          =   285
  71.       Left            =   2640
  72.       TabIndex        =   4
  73.       Top             =   1560
  74.       Width           =   1215
  75.    End
  76.    Begin TextBox txtMgr 
  77.       Height          =   285
  78.       Left            =   2640
  79.       TabIndex        =   3
  80.       Top             =   1200
  81.       Width           =   1215
  82.    End
  83.    Begin TextBox txtJob 
  84.       Height          =   285
  85.       Left            =   2640
  86.       TabIndex        =   2
  87.       Top             =   840
  88.       Width           =   2895
  89.    End
  90.    Begin TextBox txtEname 
  91.       Height          =   285
  92.       Left            =   2640
  93.       TabIndex        =   1
  94.       Top             =   480
  95.       Width           =   2895
  96.    End
  97.    Begin TextBox txtEmpno 
  98.       Height          =   285
  99.       Left            =   2640
  100.       TabIndex        =   0
  101.       Top             =   120
  102.       Width           =   1215
  103.    End
  104.    Begin Label Label8 
  105.       Alignment       =   1  'Right Justify
  106.       AutoSize        =   -1  'True
  107.       Caption         =   "Department Number:"
  108.       FontBold        =   -1  'True
  109.       FontItalic      =   0   'False
  110.       FontName        =   "MS Sans Serif"
  111.       FontSize        =   9.75
  112.       FontStrikethru  =   0   'False
  113.       FontUnderline   =   0   'False
  114.       Height          =   255
  115.       Left            =   360
  116.       TabIndex        =   19
  117.       Top             =   2640
  118.       Width           =   2175
  119.    End
  120.    Begin Label Label7 
  121.       Alignment       =   1  'Right Justify
  122.       AutoSize        =   -1  'True
  123.       Caption         =   "Commission:"
  124.       FontBold        =   -1  'True
  125.       FontItalic      =   0   'False
  126.       FontName        =   "MS Sans Serif"
  127.       FontSize        =   9.75
  128.       FontStrikethru  =   0   'False
  129.       FontUnderline   =   0   'False
  130.       Height          =   255
  131.       Left            =   1200
  132.       TabIndex        =   18
  133.       Top             =   2280
  134.       Width           =   1335
  135.    End
  136.    Begin Label Label6 
  137.       Alignment       =   1  'Right Justify
  138.       AutoSize        =   -1  'True
  139.       Caption         =   "Salary:"
  140.       FontBold        =   -1  'True
  141.       FontItalic      =   0   'False
  142.       FontName        =   "MS Sans Serif"
  143.       FontSize        =   9.75
  144.       FontStrikethru  =   0   'False
  145.       FontUnderline   =   0   'False
  146.       Height          =   255
  147.       Left            =   1680
  148.       TabIndex        =   17
  149.       Top             =   1920
  150.       Width           =   855
  151.    End
  152.    Begin Label Label5 
  153.       Alignment       =   1  'Right Justify
  154.       AutoSize        =   -1  'True
  155.       Caption         =   "Hire Date:"
  156.       FontBold        =   -1  'True
  157.       FontItalic      =   0   'False
  158.       FontName        =   "MS Sans Serif"
  159.       FontSize        =   9.75
  160.       FontStrikethru  =   0   'False
  161.       FontUnderline   =   0   'False
  162.       Height          =   255
  163.       Left            =   1440
  164.       TabIndex        =   16
  165.       Top             =   1560
  166.       Width           =   1095
  167.    End
  168.    Begin Label Label4 
  169.       Alignment       =   1  'Right Justify
  170.       AutoSize        =   -1  'True
  171.       Caption         =   "Manager:"
  172.       FontBold        =   -1  'True
  173.       FontItalic      =   0   'False
  174.       FontName        =   "MS Sans Serif"
  175.       FontSize        =   9.75
  176.       FontStrikethru  =   0   'False
  177.       FontUnderline   =   0   'False
  178.       Height          =   240
  179.       Left            =   1560
  180.       TabIndex        =   15
  181.       Top             =   1200
  182.       Width           =   990
  183.    End
  184.    Begin Label Label3 
  185.       Alignment       =   1  'Right Justify
  186.       AutoSize        =   -1  'True
  187.       Caption         =   "Job:"
  188.       FontBold        =   -1  'True
  189.       FontItalic      =   0   'False
  190.       FontName        =   "MS Sans Serif"
  191.       FontSize        =   9.75
  192.       FontStrikethru  =   0   'False
  193.       FontUnderline   =   0   'False
  194.       Height          =   255
  195.       Left            =   2040
  196.       TabIndex        =   14
  197.       Top             =   840
  198.       Width           =   495
  199.    End
  200.    Begin Label Label2 
  201.       Alignment       =   1  'Right Justify
  202.       AutoSize        =   -1  'True
  203.       Caption         =   "Employee Name:"
  204.       FontBold        =   -1  'True
  205.       FontItalic      =   0   'False
  206.       FontName        =   "MS Sans Serif"
  207.       FontSize        =   9.75
  208.       FontStrikethru  =   0   'False
  209.       FontUnderline   =   0   'False
  210.       Height          =   255
  211.       Left            =   720
  212.       TabIndex        =   13
  213.       Top             =   480
  214.       Width           =   1815
  215.    End
  216.    Begin Label Label1 
  217.       Alignment       =   1  'Right Justify
  218.       AutoSize        =   -1  'True
  219.       Caption         =   "Employee Number:"
  220.       FontBold        =   -1  'True
  221.       FontItalic      =   0   'False
  222.       FontName        =   "MS Sans Serif"
  223.       FontSize        =   9.75
  224.       FontStrikethru  =   0   'False
  225.       FontUnderline   =   0   'False
  226.       Height          =   255
  227.       Left            =   480
  228.       TabIndex        =   12
  229.       Top             =   120
  230.       Width           =   2055
  231.    End
  232.    Begin Menu mExit 
  233.       Caption         =   "E&xit!"
  234.    End
  235. Sub cmdFirst_Click ()
  236.  EmpDynaset.DbMoveFirst
  237.  If EmpDynaset.BOF = True Then
  238.   MsgBox WarnFirstEmp$
  239.   EmpDynaset.DbMoveFirst
  240.  End If
  241.  Call EmpRefresh
  242. End Sub
  243. Sub cmdLast_Click ()
  244.  EmpDynaset.DbMoveLast
  245.  If EmpDynaset.EOF = True Then
  246.   MsgBox WarnLastEmp$
  247.   EmpDynaset.DbMoveLast
  248.  End If
  249.  Call EmpRefresh
  250. End Sub
  251. Sub cmdNext_Click ()
  252.  If EmpDynaset.EOF <> True Then
  253.   EmpDynaset.DbMoveNext
  254.   If EmpDynaset.EOF = True Then
  255.    MsgBox WarnLastEmp$
  256.    EmpDynaset.DbMoveLast
  257.   End If
  258.  End If
  259.  Call EmpRefresh
  260. End Sub
  261. Sub cmdPrevious_Click ()
  262.  If EmpDynaset.BOF <> True Then
  263.   EmpDynaset.DbMovePrevious
  264.   If EmpDynaset.BOF = True Then
  265.    MsgBox WarnFirstEmp$
  266.    EmpDynaset.DbMoveFirst
  267.   End If
  268.  End If
  269.  Call EmpRefresh
  270. End Sub
  271. Sub EmpRefresh ()
  272.  If EmpDynaset.BOF <> True And EmpDynaset.EOF <> True Then
  273.   txtEmpno = EmpDynaset.Fields("empno").value
  274.   txtEname = EmpDynaset.Fields("ename").value
  275.   txtJob = EmpDynaset.Fields("job").value
  276.   'check if mgr=nul
  277.   If Not IsNull(EmpDynaset.Fields("mgr").value) Then
  278.    txtMgr = EmpDynaset.Fields("mgr").value
  279.   Else
  280.    txtMgr = ""
  281.   End If
  282.   txtHireDate = EmpDynaset.Fields("hiredate").value
  283.   txtSal = EmpDynaset.Fields("sal").value
  284.   'check if comm=nul
  285.   If Not IsNull(EmpDynaset.Fields("comm").value) Then
  286.    txtComm = EmpDynaset.Fields("comm").value
  287.   Else
  288.    txtComm = ""
  289.   End If
  290.   txtDeptno = EmpDynaset.Fields("deptno").value
  291.  Else
  292.   txtEmpno = ""
  293.   txtEname = ""
  294.   txtJob = ""
  295.   txtMgr = ""
  296.   txtHireDate = ""
  297.   txtSal = ""
  298.   txtComm = ""
  299.   txtDeptno = ""
  300.  End If
  301. End Sub
  302. Sub Form_Load ()
  303. 'OraSession and OraDatabase are global
  304.  Set OraSession = CreateObject("OracleInProcServer.XOraSession")
  305.  Set OraDatabase = OraSession.OpenDatabase(DatabaseName$, Connect$, 0&)
  306.  Set EmpDynaset = OraDatabase.DbCreateDynaset(EmpQuery$, 0&)
  307.  Call EmpRefresh
  308. End Sub
  309. Sub mExit_Click ()
  310. End Sub
  311.