main_rsgl_pygl.frm
上传用户:wd52qq
上传日期:2022-07-24
资源大小:5366k
文件大小:23k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
  4. Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
  5. Begin VB.Form main_rsgl_pygl 
  6.    BorderStyle     =   3  'Fixed Dialog
  7.    Caption         =   "Form1"
  8.    ClientHeight    =   5880
  9.    ClientLeft      =   45
  10.    ClientTop       =   330
  11.    ClientWidth     =   11820
  12.    Icon            =   "main_rsgl_pygl.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   5880
  17.    ScaleWidth      =   11820
  18.    ShowInTaskbar   =   0   'False
  19.    StartUpPosition =   2  '屏幕中心
  20.    Begin MSAdodcLib.Adodc Adodc1 
  21.       Height          =   330
  22.       Left            =   60
  23.       Top             =   2040
  24.       Visible         =   0   'False
  25.       Width           =   2040
  26.       _ExtentX        =   3598
  27.       _ExtentY        =   582
  28.       ConnectMode     =   0
  29.       CursorLocation  =   3
  30.       IsolationLevel  =   -1
  31.       ConnectionTimeout=   15
  32.       CommandTimeout  =   30
  33.       CursorType      =   3
  34.       LockType        =   3
  35.       CommandType     =   2
  36.       CursorOptions   =   0
  37.       CacheSize       =   50
  38.       MaxRecords      =   0
  39.       BOFAction       =   0
  40.       EOFAction       =   0
  41.       ConnectStringType=   1
  42.       Appearance      =   1
  43.       BackColor       =   -2147483643
  44.       ForeColor       =   -2147483640
  45.       Orientation     =   0
  46.       Enabled         =   -1
  47.       Connect         =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
  48.       OLEDBString     =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
  49.       OLEDBFile       =   ""
  50.       DataSourceName  =   ""
  51.       OtherAttributes =   ""
  52.       UserName        =   ""
  53.       Password        =   ""
  54.       RecordSource    =   "聘用表"
  55.       Caption         =   "Adodc1"
  56.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  57.          Name            =   "宋体"
  58.          Size            =   9
  59.          Charset         =   134
  60.          Weight          =   400
  61.          Underline       =   0   'False
  62.          Italic          =   0   'False
  63.          Strikethrough   =   0   'False
  64.       EndProperty
  65.       _Version        =   393216
  66.    End
  67.    Begin MSComctlLib.ImageList ImageList1 
  68.       Left            =   1875
  69.       Top             =   2730
  70.       _ExtentX        =   1005
  71.       _ExtentY        =   1005
  72.       BackColor       =   -2147483643
  73.       ImageWidth      =   32
  74.       ImageHeight     =   32
  75.       MaskColor       =   12632256
  76.       _Version        =   393216
  77.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  78.          NumListImages   =   13
  79.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  80.             Picture         =   "main_rsgl_pygl.frx":000C
  81.             Key             =   ""
  82.          EndProperty
  83.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  84.             Picture         =   "main_rsgl_pygl.frx":0786
  85.             Key             =   ""
  86.          EndProperty
  87.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  88.             Picture         =   "main_rsgl_pygl.frx":1460
  89.             Key             =   ""
  90.          EndProperty
  91.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  92.             Picture         =   "main_rsgl_pygl.frx":1D3A
  93.             Key             =   ""
  94.          EndProperty
  95.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  96.             Picture         =   "main_rsgl_pygl.frx":2614
  97.             Key             =   ""
  98.          EndProperty
  99.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  100.             Picture         =   "main_rsgl_pygl.frx":2EEE
  101.             Key             =   ""
  102.          EndProperty
  103.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  104.             Picture         =   "main_rsgl_pygl.frx":3BC8
  105.             Key             =   ""
  106.          EndProperty
  107.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  108.             Picture         =   "main_rsgl_pygl.frx":44A2
  109.             Key             =   ""
  110.          EndProperty
  111.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  112.             Picture         =   "main_rsgl_pygl.frx":4D7C
  113.             Key             =   ""
  114.          EndProperty
  115.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  116.             Picture         =   "main_rsgl_pygl.frx":5656
  117.             Key             =   ""
  118.          EndProperty
  119.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  120.             Picture         =   "main_rsgl_pygl.frx":5F30
  121.             Key             =   ""
  122.          EndProperty
  123.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  124.             Picture         =   "main_rsgl_pygl.frx":6C0A
  125.             Key             =   ""
  126.          EndProperty
  127.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  128.             Picture         =   "main_rsgl_pygl.frx":7604
  129.             Key             =   ""
  130.          EndProperty
  131.       EndProperty
  132.    End
  133.    Begin MSComctlLib.Toolbar Toolbar1 
  134.       Align           =   1  'Align Top
  135.       Height          =   795
  136.       Left            =   0
  137.       TabIndex        =   0
  138.       Top             =   0
  139.       Width           =   11820
  140.       _ExtentX        =   20849
  141.       _ExtentY        =   1402
  142.       ButtonWidth     =   1455
  143.       ButtonHeight    =   1349
  144.       Appearance      =   1
  145.       Style           =   1
  146.       ImageList       =   "ImageList1"
  147.       _Version        =   393216
  148.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  149.          NumButtons      =   17
  150.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  151.             Caption         =   "查找"
  152.             Key             =   "find"
  153.             ImageIndex      =   1
  154.          EndProperty
  155.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  156.             Caption         =   "全部"
  157.             Key             =   "all"
  158.             ImageIndex      =   2
  159.          EndProperty
  160.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  161.             Style           =   3
  162.          EndProperty
  163.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  164.             Caption         =   "增加"
  165.             Key             =   "add"
  166.             ImageIndex      =   3
  167.          EndProperty
  168.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  169.             Caption         =   "修改"
  170.             Key             =   "modify"
  171.             ImageIndex      =   4
  172.          EndProperty
  173.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  174.             Caption         =   "删除"
  175.             Key             =   "delete"
  176.             ImageIndex      =   5
  177.          EndProperty
  178.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  179.             Style           =   3
  180.          EndProperty
  181.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  182.             Caption         =   "续约"
  183.             Key             =   "addpact"
  184.             ImageIndex      =   6
  185.          EndProperty
  186.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  187.             Caption         =   "生效"
  188.             Key             =   "takee"
  189.             ImageIndex      =   7
  190.          EndProperty
  191.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  192.             Caption         =   "解除"
  193.             Key             =   "undo"
  194.             ImageIndex      =   8
  195.          EndProperty
  196.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  197.             Caption         =   "试用"
  198.             Key             =   "test"
  199.             ImageIndex      =   9
  200.          EndProperty
  201.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  202.             Caption         =   "转正"
  203.             Key             =   "change"
  204.             ImageIndex      =   10
  205.          EndProperty
  206.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  207.             Caption         =   "到期处理"
  208.             Key             =   "atterm"
  209.             ImageIndex      =   11
  210.          EndProperty
  211.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  212.             Style           =   3
  213.          EndProperty
  214.          BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  215.             Caption         =   "Excel"
  216.             Key             =   "excel"
  217.             ImageIndex      =   12
  218.          EndProperty
  219.          BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  220.             Style           =   3
  221.          EndProperty
  222.          BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  223.             Caption         =   "关闭"
  224.             Key             =   "close"
  225.             ImageIndex      =   13
  226.          EndProperty
  227.       EndProperty
  228.       BorderStyle     =   1
  229.    End
  230.    Begin MSDataGridLib.DataGrid DataGrid1 
  231.       Bindings        =   "main_rsgl_pygl.frx":7EDE
  232.       Height          =   5010
  233.       Left            =   15
  234.       TabIndex        =   1
  235.       Top             =   825
  236.       Width           =   11760
  237.       _ExtentX        =   20743
  238.       _ExtentY        =   8837
  239.       _Version        =   393216
  240.       AllowUpdate     =   0   'False
  241.       HeadLines       =   1
  242.       RowHeight       =   15
  243.       FormatLocked    =   -1  'True
  244.       BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  245.          Name            =   "宋体"
  246.          Size            =   9
  247.          Charset         =   134
  248.          Weight          =   400
  249.          Underline       =   0   'False
  250.          Italic          =   0   'False
  251.          Strikethrough   =   0   'False
  252.       EndProperty
  253.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  254.          Name            =   "宋体"
  255.          Size            =   9
  256.          Charset         =   134
  257.          Weight          =   400
  258.          Underline       =   0   'False
  259.          Italic          =   0   'False
  260.          Strikethrough   =   0   'False
  261.       EndProperty
  262.       ColumnCount     =   12
  263.       BeginProperty Column00 
  264.          DataField       =   "员工编号"
  265.          Caption         =   "员工编号"
  266.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  267.             Type            =   0
  268.             Format          =   ""
  269.             HaveTrueFalseNull=   0
  270.             FirstDayOfWeek  =   0
  271.             FirstWeekOfYear =   0
  272.             LCID            =   2052
  273.             SubFormatType   =   0
  274.          EndProperty
  275.       EndProperty
  276.       BeginProperty Column01 
  277.          DataField       =   "员工姓名"
  278.          Caption         =   "员工姓名"
  279.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  280.             Type            =   0
  281.             Format          =   ""
  282.             HaveTrueFalseNull=   0
  283.             FirstDayOfWeek  =   0
  284.             FirstWeekOfYear =   0
  285.             LCID            =   2052
  286.             SubFormatType   =   0
  287.          EndProperty
  288.       EndProperty
  289.       BeginProperty Column02 
  290.          DataField       =   "聘用编号"
  291.          Caption         =   "聘用编号"
  292.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  293.             Type            =   0
  294.             Format          =   ""
  295.             HaveTrueFalseNull=   0
  296.             FirstDayOfWeek  =   0
  297.             FirstWeekOfYear =   0
  298.             LCID            =   2052
  299.             SubFormatType   =   0
  300.          EndProperty
  301.       EndProperty
  302.       BeginProperty Column03 
  303.          DataField       =   "聘用类型"
  304.          Caption         =   "聘用类型"
  305.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  306.             Type            =   0
  307.             Format          =   ""
  308.             HaveTrueFalseNull=   0
  309.             FirstDayOfWeek  =   0
  310.             FirstWeekOfYear =   0
  311.             LCID            =   2052
  312.             SubFormatType   =   0
  313.          EndProperty
  314.       EndProperty
  315.       BeginProperty Column04 
  316.          DataField       =   "聘用开始日期"
  317.          Caption         =   "聘用开始日期"
  318.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  319.             Type            =   0
  320.             Format          =   ""
  321.             HaveTrueFalseNull=   0
  322.             FirstDayOfWeek  =   0
  323.             FirstWeekOfYear =   0
  324.             LCID            =   2052
  325.             SubFormatType   =   0
  326.          EndProperty
  327.       EndProperty
  328.       BeginProperty Column05 
  329.          DataField       =   "聘用结束日期"
  330.          Caption         =   "聘用结束日期"
  331.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  332.             Type            =   0
  333.             Format          =   ""
  334.             HaveTrueFalseNull=   0
  335.             FirstDayOfWeek  =   0
  336.             FirstWeekOfYear =   0
  337.             LCID            =   2052
  338.             SubFormatType   =   0
  339.          EndProperty
  340.       EndProperty
  341.       BeginProperty Column06 
  342.          DataField       =   "聘用期限"
  343.          Caption         =   "聘用期限"
  344.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  345.             Type            =   0
  346.             Format          =   ""
  347.             HaveTrueFalseNull=   0
  348.             FirstDayOfWeek  =   0
  349.             FirstWeekOfYear =   0
  350.             LCID            =   2052
  351.             SubFormatType   =   0
  352.          EndProperty
  353.       EndProperty
  354.       BeginProperty Column07 
  355.          DataField       =   "聘用期工资"
  356.          Caption         =   "聘用期工资"
  357.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  358.             Type            =   0
  359.             Format          =   ""
  360.             HaveTrueFalseNull=   0
  361.             FirstDayOfWeek  =   0
  362.             FirstWeekOfYear =   0
  363.             LCID            =   2052
  364.             SubFormatType   =   0
  365.          EndProperty
  366.       EndProperty
  367.       BeginProperty Column08 
  368.          DataField       =   "试用期"
  369.          Caption         =   "试用期"
  370.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  371.             Type            =   0
  372.             Format          =   ""
  373.             HaveTrueFalseNull=   0
  374.             FirstDayOfWeek  =   0
  375.             FirstWeekOfYear =   0
  376.             LCID            =   2052
  377.             SubFormatType   =   0
  378.          EndProperty
  379.       EndProperty
  380.       BeginProperty Column09 
  381.          DataField       =   "试用期工资"
  382.          Caption         =   "试用期工资"
  383.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  384.             Type            =   0
  385.             Format          =   ""
  386.             HaveTrueFalseNull=   0
  387.             FirstDayOfWeek  =   0
  388.             FirstWeekOfYear =   0
  389.             LCID            =   2052
  390.             SubFormatType   =   0
  391.          EndProperty
  392.       EndProperty
  393.       BeginProperty Column10 
  394.          DataField       =   "备注"
  395.          Caption         =   "备注"
  396.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  397.             Type            =   0
  398.             Format          =   ""
  399.             HaveTrueFalseNull=   0
  400.             FirstDayOfWeek  =   0
  401.             FirstWeekOfYear =   0
  402.             LCID            =   2052
  403.             SubFormatType   =   0
  404.          EndProperty
  405.       EndProperty
  406.       BeginProperty Column11 
  407.          DataField       =   "状态"
  408.          Caption         =   "状态"
  409.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  410.             Type            =   0
  411.             Format          =   ""
  412.             HaveTrueFalseNull=   0
  413.             FirstDayOfWeek  =   0
  414.             FirstWeekOfYear =   0
  415.             LCID            =   2052
  416.             SubFormatType   =   0
  417.          EndProperty
  418.       EndProperty
  419.       SplitCount      =   1
  420.       BeginProperty Split0 
  421.          MarqueeStyle    =   4
  422.          BeginProperty Column00 
  423.             ColumnWidth     =   915.024
  424.          EndProperty
  425.          BeginProperty Column01 
  426.             ColumnWidth     =   1365.165
  427.          EndProperty
  428.          BeginProperty Column02 
  429.             ColumnWidth     =   1814.74
  430.          EndProperty
  431.          BeginProperty Column03 
  432.             ColumnWidth     =   1365.165
  433.          EndProperty
  434.          BeginProperty Column04 
  435.             ColumnWidth     =   2085.166
  436.          EndProperty
  437.          BeginProperty Column05 
  438.             ColumnWidth     =   2085.166
  439.          EndProperty
  440.          BeginProperty Column06 
  441.             ColumnWidth     =   1275.024
  442.          EndProperty
  443.          BeginProperty Column07 
  444.             ColumnWidth     =   2085.166
  445.          EndProperty
  446.          BeginProperty Column08 
  447.             ColumnWidth     =   1094.74
  448.          EndProperty
  449.          BeginProperty Column09 
  450.             ColumnWidth     =   2085.166
  451.          EndProperty
  452.          BeginProperty Column10 
  453.             ColumnWidth     =   2085.166
  454.          EndProperty
  455.          BeginProperty Column11 
  456.             ColumnWidth     =   824.882
  457.          EndProperty
  458.       EndProperty
  459.    End
  460. End
  461. Attribute VB_Name = "main_rsgl_pygl"
  462. Attribute VB_GlobalNameSpace = False
  463. Attribute VB_Creatable = False
  464. Attribute VB_PredeclaredId = True
  465. Attribute VB_Exposed = False
  466. Dim rs1 As New ADODB.Recordset
  467. Dim i As Integer
  468. Private Sub SetButtons()
  469.   For i = 5 To 12
  470.    Toolbar1.Buttons(i).Enabled = True
  471.   Next i
  472. End Sub
  473. Private Sub DataGrid1_DblClick()
  474.    If Adodc1.Recordset.RecordCount > 0 Then
  475.      blnAddPY = False
  476.      Load main_rsgl_pygl_lr
  477.      main_rsgl_pygl_lr.Show 1
  478.    End If
  479. End Sub
  480. Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
  481.  On Error Resume Next
  482.  With Adodc1.Recordset
  483.    If .RecordCount > 0 Then
  484.       On Error Resume Next
  485.       SetButtons
  486.       Select Case .Fields("状态")
  487.         Case "到期"
  488.           For i = 9 To 12
  489.             Toolbar1.Buttons(i).Enabled = False
  490.           Next i
  491.         Case "生效"
  492.           Toolbar1.Buttons(8).Enabled = False
  493.           Toolbar1.Buttons(9).Enabled = False
  494.           Toolbar1.Buttons(12).Enabled = False
  495.         Case "解除"
  496.           Toolbar1.Buttons(8).Enabled = False
  497.           Toolbar1.Buttons(10).Enabled = False
  498.         Case "试用"
  499.           Toolbar1.Buttons(8).Enabled = False
  500.           Toolbar1.Buttons(11).Enabled = False
  501.         End Select
  502.     End If
  503.   End With
  504. End Sub
  505. Private Sub Form_Activate()
  506.   If sql1 <> "" Then
  507.      Adodc1.RecordSource = sql1
  508.      Adodc1.Refresh
  509.      If Adodc1.Recordset.RecordCount > 0 Then
  510.      Else
  511.         MsgBox "没有找到符合条件的记录!", , "提示窗口"
  512.      End If
  513.   End If
  514. End Sub
  515. Private Sub Form_Load()
  516.   Me.Caption = text
  517.   DataGrid1_RowColChange 0, 0
  518. End Sub
  519. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  520.   sql1 = ""
  521. End Sub
  522. Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
  523.   Dim newsql As String
  524.   If sql1 <> "" And tb1 <> "" Then
  525.     newsql = Mid(sql1, Len(tb1), Len(sql1))
  526.   End If
  527.   Select Case Button.Key
  528.      Case "add"
  529.        blnAddPY = True
  530.        main_yyxx.Tag = 4
  531.        Load main_yyxx
  532.        main_yyxx.Show 1
  533.      Case "modify"
  534.        If Adodc1.Recordset.RecordCount > 0 Then
  535.          blnAddPY = False
  536.          Load main_rsgl_pygl_lr
  537.          main_rsgl_pygl_lr.Show 1
  538.        Else
  539.          MsgBox "系统没有要修改的数据!", , "提示窗口"
  540.        End If
  541.      Case "delete"
  542.        If Adodc1.Recordset.RecordCount > 0 Then
  543.          Adodc1.Recordset.Delete
  544.          Adodc1.Refresh
  545.        Else
  546.          For i = 5 To 15
  547.           Toolbar1.Buttons(i).Enabled = False
  548.          Next i
  549.          MsgBox "系统没有要删除的数据!", , "提示窗口"
  550.        End If
  551.      Case "find"
  552.        tb1 = "聘用表"
  553.        Load main_fzfind
  554.        main_fzfind.Show 1
  555.      Case "addpact"
  556.        Load main_pyxy
  557.        main_pyxy.Show 1
  558.      Case "takee"
  559.        If newsql <> "" Then
  560.          Cnn.Execute ("update 聘用表 set 状态='生效'" & newsql & " and 员工编号='" + DataGrid1.Columns(0) + "'")
  561.        Else
  562.          Cnn.Execute ("update 聘用表 set 状态='生效'where 员工编号='" + DataGrid1.Columns(0) + "'")
  563.        End If
  564.        Adodc1.Refresh
  565.      Case "undo"
  566.        If newsql <> "" Then
  567.          Cnn.Execute ("update 聘用表 set 状态='解除'" & newsql & " and 员工编号='" + DataGrid1.Columns(0) + "'")
  568.        Else
  569.          Cnn.Execute ("update 聘用表 set 状态='解除' where 员工编号='" + DataGrid1.Columns(0) + "'")
  570.        End If
  571.        Adodc1.Refresh
  572.      Case "test"
  573.        If newsql <> "" Then
  574.          Cnn.Execute ("update 聘用表 set 状态='试用'" & newsql & " and 员工编号='" + DataGrid1.Columns(0) + "'")
  575.        Else
  576.          Cnn.Execute ("update 聘用表 set 状态='试用'where 员工编号='" + DataGrid1.Columns(0) + "'")
  577.        End If
  578.        Adodc1.Refresh
  579.      Case "change"
  580.        If newsql <> "" Then
  581.          Cnn.Execute ("update 聘用表 set 状态='生效'" & newsql & " and 员工编号='" + DataGrid1.Columns(0) + "'")
  582.        Else
  583.          Cnn.Execute ("update 聘用表 set 状态='生效'where 员工编号='" + DataGrid1.Columns(0) + "'")
  584.        End If
  585.        Adodc1.Refresh
  586.      Case "atterm"
  587.        If newsql <> "" Then
  588.          Cnn.Execute ("update 聘用表 set 状态='到期'" & newsql & " and 员工编号='" + DataGrid1.Columns(0) + "'and 聘用结束日期>" & Date)
  589.        Else
  590.          Cnn.Execute ("update 聘用表 set 状态='到期' where 员工编号='" + DataGrid1.Columns(0) + "'and 聘用结束日期>" & Date)
  591.        End If
  592.        Adodc1.Refresh
  593.      Case "excel"
  594.        Dim r As Integer, c As Integer
  595.        Dim newxls As Excel.Application
  596.        Dim newbook As Excel.Workbook
  597.        Dim newsheet As Excel.Worksheet
  598.        Set newxls = CreateObject("Excel.Application") '创建excel应用程序,打开excel2000
  599.        Set newbook = newxls.Workbooks.Add   '创建工作簿
  600.        Set newsheet = newbook.Worksheets(1) '创建工作表
  601.        If sql1 <> "" Then
  602.          Adodc1.RecordSource = sql1
  603.          Adodc1.Refresh
  604.        End If
  605.        If Adodc1.Recordset.RecordCount > 0 Then
  606.          newxls.Visible = True
  607.          For i = 0 To DataGrid1.Columns.Count - 1
  608.               newsheet.Cells(1, i + 1) = DataGrid1.Columns(i).Caption
  609.          Next i
  610.          '指定表格内容
  611.          Adodc1.Recordset.MoveFirst
  612.          Do Until Adodc1.Recordset.EOF
  613.               r = Adodc1.Recordset.AbsolutePosition
  614.               For c = 0 To DataGrid1.Columns.Count - 1
  615.                   newsheet.Cells(r + 1, c + 1) = DataGrid1.Columns(c)
  616.               Next c
  617.               Adodc1.Recordset.MoveNext
  618.          Loop
  619. ErrSave:
  620.            Exit Sub
  621.            MsgBox Err.Description, , "提示窗口"
  622.          End If
  623.      Case "close"
  624.        Unload Me
  625.   End Select
  626. End Sub