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

企业管理

开发平台:

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_gzgl_gzgl 
  6.    BorderStyle     =   3  'Fixed Dialog
  7.    Caption         =   "Form1"
  8.    ClientHeight    =   5880
  9.    ClientLeft      =   45
  10.    ClientTop       =   330
  11.    ClientWidth     =   10350
  12.    Icon            =   "main_gzgl_gzgl.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   5880
  17.    ScaleWidth      =   10350
  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     =   1
  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    =   "select * from 工资表"
  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             =   2715
  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   =   9
  79.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  80.             Picture         =   "main_gzgl_gzgl.frx":000C
  81.             Key             =   ""
  82.          EndProperty
  83.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  84.             Picture         =   "main_gzgl_gzgl.frx":0CE6
  85.             Key             =   ""
  86.          EndProperty
  87.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  88.             Picture         =   "main_gzgl_gzgl.frx":1460
  89.             Key             =   ""
  90.          EndProperty
  91.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  92.             Picture         =   "main_gzgl_gzgl.frx":1D3A
  93.             Key             =   ""
  94.          EndProperty
  95.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  96.             Picture         =   "main_gzgl_gzgl.frx":2614
  97.             Key             =   ""
  98.          EndProperty
  99.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  100.             Picture         =   "main_gzgl_gzgl.frx":2EEE
  101.             Key             =   ""
  102.          EndProperty
  103.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  104.             Picture         =   "main_gzgl_gzgl.frx":38E8
  105.             Key             =   ""
  106.          EndProperty
  107.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  108.             Picture         =   "main_gzgl_gzgl.frx":41C2
  109.             Key             =   ""
  110.          EndProperty
  111.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  112.             Picture         =   "main_gzgl_gzgl.frx":4A9C
  113.             Key             =   ""
  114.          EndProperty
  115.       EndProperty
  116.    End
  117.    Begin MSComctlLib.Toolbar Toolbar1 
  118.       Align           =   1  'Align Top
  119.       Height          =   795
  120.       Left            =   0
  121.       TabIndex        =   0
  122.       Top             =   0
  123.       Width           =   10350
  124.       _ExtentX        =   18256
  125.       _ExtentY        =   1402
  126.       ButtonWidth     =   1455
  127.       ButtonHeight    =   1349
  128.       Appearance      =   1
  129.       Style           =   1
  130.       ImageList       =   "ImageList1"
  131.       _Version        =   393216
  132.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  133.          NumButtons      =   11
  134.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  135.             Caption         =   "当前月份"
  136.             Key             =   "all"
  137.             ImageIndex      =   1
  138.          EndProperty
  139.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  140.             Caption         =   "查找"
  141.             Key             =   "find"
  142.             ImageIndex      =   2
  143.          EndProperty
  144.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  145.             Style           =   3
  146.          EndProperty
  147.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  148.             Caption         =   "修改"
  149.             Key             =   "modify"
  150.             ImageIndex      =   3
  151.          EndProperty
  152.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  153.             Caption         =   "批量修改"
  154.             Key             =   "allmodify"
  155.             ImageIndex      =   4
  156.          EndProperty
  157.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  158.             Style           =   3
  159.          EndProperty
  160.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  161.             Caption         =   "Excel"
  162.             Key             =   "excel"
  163.             ImageIndex      =   6
  164.          EndProperty
  165.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  166.             Caption         =   "工资台账"
  167.             Key             =   "print"
  168.             ImageIndex      =   9
  169.          EndProperty
  170.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  171.             Caption         =   "工资条"
  172.             Key             =   "printone"
  173.             ImageIndex      =   7
  174.          EndProperty
  175.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  176.             Enabled         =   0   'False
  177.             Style           =   3
  178.          EndProperty
  179.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  180.             Caption         =   "关闭"
  181.             Key             =   "close"
  182.             ImageIndex      =   8
  183.          EndProperty
  184.       EndProperty
  185.       BorderStyle     =   1
  186.    End
  187.    Begin MSDataGridLib.DataGrid DataGrid1 
  188.       Bindings        =   "main_gzgl_gzgl.frx":5776
  189.       Height          =   5010
  190.       Left            =   15
  191.       TabIndex        =   1
  192.       Top             =   825
  193.       Width           =   10290
  194.       _ExtentX        =   18150
  195.       _ExtentY        =   8837
  196.       _Version        =   393216
  197.       AllowUpdate     =   0   'False
  198.       HeadLines       =   1
  199.       RowHeight       =   15
  200.       FormatLocked    =   -1  'True
  201.       BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  202.          Name            =   "宋体"
  203.          Size            =   9
  204.          Charset         =   134
  205.          Weight          =   400
  206.          Underline       =   0   'False
  207.          Italic          =   0   'False
  208.          Strikethrough   =   0   'False
  209.       EndProperty
  210.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  211.          Name            =   "宋体"
  212.          Size            =   9
  213.          Charset         =   134
  214.          Weight          =   400
  215.          Underline       =   0   'False
  216.          Italic          =   0   'False
  217.          Strikethrough   =   0   'False
  218.       EndProperty
  219.       ColumnCount     =   17
  220.       BeginProperty Column00 
  221.          DataField       =   "所属工资月份"
  222.          Caption         =   "所属工资月份"
  223.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  224.             Type            =   0
  225.             Format          =   ""
  226.             HaveTrueFalseNull=   0
  227.             FirstDayOfWeek  =   0
  228.             FirstWeekOfYear =   0
  229.             LCID            =   2052
  230.             SubFormatType   =   0
  231.          EndProperty
  232.       EndProperty
  233.       BeginProperty Column01 
  234.          DataField       =   "员工编号"
  235.          Caption         =   "员工编号"
  236.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  237.             Type            =   0
  238.             Format          =   ""
  239.             HaveTrueFalseNull=   0
  240.             FirstDayOfWeek  =   0
  241.             FirstWeekOfYear =   0
  242.             LCID            =   2052
  243.             SubFormatType   =   0
  244.          EndProperty
  245.       EndProperty
  246.       BeginProperty Column02 
  247.          DataField       =   "员工姓名"
  248.          Caption         =   "员工姓名"
  249.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  250.             Type            =   0
  251.             Format          =   ""
  252.             HaveTrueFalseNull=   0
  253.             FirstDayOfWeek  =   0
  254.             FirstWeekOfYear =   0
  255.             LCID            =   2052
  256.             SubFormatType   =   0
  257.          EndProperty
  258.       EndProperty
  259.       BeginProperty Column03 
  260.          DataField       =   "基本工资"
  261.          Caption         =   "基本工资"
  262.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  263.             Type            =   0
  264.             Format          =   ""
  265.             HaveTrueFalseNull=   0
  266.             FirstDayOfWeek  =   0
  267.             FirstWeekOfYear =   0
  268.             LCID            =   2052
  269.             SubFormatType   =   0
  270.          EndProperty
  271.       EndProperty
  272.       BeginProperty Column04 
  273.          DataField       =   "加班费"
  274.          Caption         =   "加班费"
  275.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  276.             Type            =   0
  277.             Format          =   ""
  278.             HaveTrueFalseNull=   0
  279.             FirstDayOfWeek  =   0
  280.             FirstWeekOfYear =   0
  281.             LCID            =   2052
  282.             SubFormatType   =   0
  283.          EndProperty
  284.       EndProperty
  285.       BeginProperty Column05 
  286.          DataField       =   "工龄工资"
  287.          Caption         =   "工龄工资"
  288.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  289.             Type            =   0
  290.             Format          =   ""
  291.             HaveTrueFalseNull=   0
  292.             FirstDayOfWeek  =   0
  293.             FirstWeekOfYear =   0
  294.             LCID            =   2052
  295.             SubFormatType   =   0
  296.          EndProperty
  297.       EndProperty
  298.       BeginProperty Column06 
  299.          DataField       =   "全勤奖"
  300.          Caption         =   "全勤奖"
  301.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  302.             Type            =   0
  303.             Format          =   ""
  304.             HaveTrueFalseNull=   0
  305.             FirstDayOfWeek  =   0
  306.             FirstWeekOfYear =   0
  307.             LCID            =   2052
  308.             SubFormatType   =   0
  309.          EndProperty
  310.       EndProperty
  311.       BeginProperty Column07 
  312.          DataField       =   "奖励总额"
  313.          Caption         =   "奖励总额"
  314.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  315.             Type            =   0
  316.             Format          =   ""
  317.             HaveTrueFalseNull=   0
  318.             FirstDayOfWeek  =   0
  319.             FirstWeekOfYear =   0
  320.             LCID            =   2052
  321.             SubFormatType   =   0
  322.          EndProperty
  323.       EndProperty
  324.       BeginProperty Column08 
  325.          DataField       =   "职务津贴"
  326.          Caption         =   "职务津贴"
  327.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  328.             Type            =   0
  329.             Format          =   ""
  330.             HaveTrueFalseNull=   0
  331.             FirstDayOfWeek  =   0
  332.             FirstWeekOfYear =   0
  333.             LCID            =   2052
  334.             SubFormatType   =   0
  335.          EndProperty
  336.       EndProperty
  337.       BeginProperty Column09 
  338.          DataField       =   "旷工费"
  339.          Caption         =   "旷工费"
  340.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  341.             Type            =   0
  342.             Format          =   ""
  343.             HaveTrueFalseNull=   0
  344.             FirstDayOfWeek  =   0
  345.             FirstWeekOfYear =   0
  346.             LCID            =   2052
  347.             SubFormatType   =   0
  348.          EndProperty
  349.       EndProperty
  350.       BeginProperty Column10 
  351.          DataField       =   "惩罚总额"
  352.          Caption         =   "惩罚总额"
  353.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  354.             Type            =   0
  355.             Format          =   ""
  356.             HaveTrueFalseNull=   0
  357.             FirstDayOfWeek  =   0
  358.             FirstWeekOfYear =   0
  359.             LCID            =   2052
  360.             SubFormatType   =   0
  361.          EndProperty
  362.       EndProperty
  363.       BeginProperty Column11 
  364.          DataField       =   "养老保险"
  365.          Caption         =   "养老保险"
  366.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  367.             Type            =   0
  368.             Format          =   ""
  369.             HaveTrueFalseNull=   0
  370.             FirstDayOfWeek  =   0
  371.             FirstWeekOfYear =   0
  372.             LCID            =   2052
  373.             SubFormatType   =   0
  374.          EndProperty
  375.       EndProperty
  376.       BeginProperty Column12 
  377.          DataField       =   "失业保险"
  378.          Caption         =   "失业保险"
  379.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  380.             Type            =   0
  381.             Format          =   ""
  382.             HaveTrueFalseNull=   0
  383.             FirstDayOfWeek  =   0
  384.             FirstWeekOfYear =   0
  385.             LCID            =   2052
  386.             SubFormatType   =   0
  387.          EndProperty
  388.       EndProperty
  389.       BeginProperty Column13 
  390.          DataField       =   "医疗保险"
  391.          Caption         =   "医疗保险"
  392.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  393.             Type            =   0
  394.             Format          =   ""
  395.             HaveTrueFalseNull=   0
  396.             FirstDayOfWeek  =   0
  397.             FirstWeekOfYear =   0
  398.             LCID            =   2052
  399.             SubFormatType   =   0
  400.          EndProperty
  401.       EndProperty
  402.       BeginProperty Column14 
  403.          DataField       =   "应发工资"
  404.          Caption         =   "应发工资"
  405.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  406.             Type            =   0
  407.             Format          =   ""
  408.             HaveTrueFalseNull=   0
  409.             FirstDayOfWeek  =   0
  410.             FirstWeekOfYear =   0
  411.             LCID            =   2052
  412.             SubFormatType   =   0
  413.          EndProperty
  414.       EndProperty
  415.       BeginProperty Column15 
  416.          DataField       =   "应扣工资"
  417.          Caption         =   "应扣工资"
  418.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  419.             Type            =   0
  420.             Format          =   ""
  421.             HaveTrueFalseNull=   0
  422.             FirstDayOfWeek  =   0
  423.             FirstWeekOfYear =   0
  424.             LCID            =   2052
  425.             SubFormatType   =   0
  426.          EndProperty
  427.       EndProperty
  428.       BeginProperty Column16 
  429.          DataField       =   "实发工资"
  430.          Caption         =   "实发工资"
  431.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  432.             Type            =   0
  433.             Format          =   ""
  434.             HaveTrueFalseNull=   0
  435.             FirstDayOfWeek  =   0
  436.             FirstWeekOfYear =   0
  437.             LCID            =   2052
  438.             SubFormatType   =   0
  439.          EndProperty
  440.       EndProperty
  441.       SplitCount      =   1
  442.       BeginProperty Split0 
  443.          MarqueeStyle    =   4
  444.          BeginProperty Column00 
  445.             ColumnWidth     =   1154.835
  446.          EndProperty
  447.          BeginProperty Column01 
  448.             ColumnWidth     =   780.095
  449.          EndProperty
  450.          BeginProperty Column02 
  451.             ColumnWidth     =   840.189
  452.          EndProperty
  453.          BeginProperty Column03 
  454.             ColumnWidth     =   1140.095
  455.          EndProperty
  456.          BeginProperty Column04 
  457.             ColumnWidth     =   720
  458.          EndProperty
  459.          BeginProperty Column05 
  460.             ColumnWidth     =   870.236
  461.          EndProperty
  462.          BeginProperty Column06 
  463.             ColumnWidth     =   675.213
  464.          EndProperty
  465.          BeginProperty Column07 
  466.             ColumnWidth     =   840.189
  467.          EndProperty
  468.          BeginProperty Column08 
  469.             ColumnWidth     =   840.189
  470.          EndProperty
  471.          BeginProperty Column09 
  472.             ColumnWidth     =   705.26
  473.          EndProperty
  474.          BeginProperty Column10 
  475.             ColumnWidth     =   900.284
  476.          EndProperty
  477.          BeginProperty Column11 
  478.             ColumnWidth     =   840.189
  479.          EndProperty
  480.          BeginProperty Column12 
  481.             ColumnWidth     =   870.236
  482.          EndProperty
  483.          BeginProperty Column13 
  484.             ColumnWidth     =   870.236
  485.          EndProperty
  486.          BeginProperty Column14 
  487.          EndProperty
  488.          BeginProperty Column15 
  489.             ColumnWidth     =   1170.142
  490.          EndProperty
  491.          BeginProperty Column16 
  492.             ColumnWidth     =   1454.74
  493.          EndProperty
  494.       EndProperty
  495.    End
  496.    Begin MSAdodcLib.Adodc Adodc2 
  497.       Height          =   330
  498.       Left            =   0
  499.       Top             =   0
  500.       Visible         =   0   'False
  501.       Width           =   2040
  502.       _ExtentX        =   3598
  503.       _ExtentY        =   582
  504.       ConnectMode     =   0
  505.       CursorLocation  =   3
  506.       IsolationLevel  =   -1
  507.       ConnectionTimeout=   15
  508.       CommandTimeout  =   30
  509.       CursorType      =   3
  510.       LockType        =   3
  511.       CommandType     =   2
  512.       CursorOptions   =   0
  513.       CacheSize       =   50
  514.       MaxRecords      =   0
  515.       BOFAction       =   0
  516.       EOFAction       =   0
  517.       ConnectStringType=   1
  518.       Appearance      =   1
  519.       BackColor       =   -2147483643
  520.       ForeColor       =   -2147483640
  521.       Orientation     =   0
  522.       Enabled         =   -1
  523.       Connect         =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
  524.       OLEDBString     =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
  525.       OLEDBFile       =   ""
  526.       DataSourceName  =   ""
  527.       OtherAttributes =   ""
  528.       UserName        =   ""
  529.       Password        =   ""
  530.       RecordSource    =   "工资公式表"
  531.       Caption         =   "Adodc1"
  532.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  533.          Name            =   "宋体"
  534.          Size            =   9
  535.          Charset         =   134
  536.          Weight          =   400
  537.          Underline       =   0   'False
  538.          Italic          =   0   'False
  539.          Strikethrough   =   0   'False
  540.       EndProperty
  541.       _Version        =   393216
  542.    End
  543. End
  544. Attribute VB_Name = "main_gzgl_gzgl"
  545. Attribute VB_GlobalNameSpace = False
  546. Attribute VB_Creatable = False
  547. Attribute VB_PredeclaredId = True
  548. Attribute VB_Exposed = False
  549. Dim rs1 As New ADODB.Recordset
  550. Public newsql As String
  551. Private Sub Form_Activate()
  552.   If sql1 <> "" Then
  553.     Adodc1.RecordSource = "select * from " & sql1
  554.     Adodc1.Refresh
  555.   Else
  556.     If Toolbar1.Buttons(1).Caption = "当前月份" Then
  557.        Adodc1.RecordSource = "select * from 工资表 where 所属工资月份=(select 月份 from 月份表) order by 所属工资月份,员工编号"
  558.        Adodc1.Refresh
  559.     Else
  560.        Adodc1.RecordSource = "select * from 工资表 order by 所属工资月份,员工编号"
  561.        Adodc1.Refresh
  562.     End If
  563.   End If
  564.   If Adodc1.Recordset.RecordCount > 0 Then
  565.   Else
  566.      MsgBox "没有找到符合条件的记录!", , "提示窗口"
  567.   End If
  568. End Sub
  569. Private Sub Form_Load()
  570.   Me.Caption = text
  571.   Adodc1.RecordSource = "select * from 工资表 where 工资表.所属工资月份=(select 月份 from 月份表)"
  572.   Adodc1.Refresh
  573.   rs1.Open "select * from 工资表 where 工资表.所属工资月份=(select 月份 from 月份表)", Cnn, adOpenKeyset, adLockOptimistic
  574.   If rs1.RecordCount > 0 Then
  575.   Else
  576.     Cnn.Execute ("insert into 工资表(员工编号,员工姓名) select 编号,姓名 from 人事表")
  577.     Cnn.Execute ("update 工资表 set 所属工资月份=月份 from 月份表 where 所属工资月份 is null")
  578.     Cnn.Execute ("update 工资表 set 基本工资=初始值 from 工资公式表 where 项目名称='基本工资'and 工资表.所属工资月份=(select 月份 from 月份表)")
  579.     Cnn.Execute ("update 工资表 set 工龄工资=初始值 from 工资公式表 where 项目名称='工龄工资'and 工资表.所属工资月份=(select 月份 from 月份表)")
  580.     Cnn.Execute ("update 工资表 set 加班费=初始值 from 工资公式表 where 项目名称='加班费'and 工资表.所属工资月份=(select 月份 from 月份表)")
  581.     Cnn.Execute ("update 工资表 set 全勤奖=初始值 from 工资公式表 where 项目名称='全勤奖'and 工资表.所属工资月份=(select 月份 from 月份表)")
  582.     Cnn.Execute ("update 工资表 set 奖励总额=奖励金额 from 员工奖励表 where 工资表.员工编号=员工奖励表.员工编号 and 工资表.所属工资月份=员工奖励表.所属工资月份")
  583.     Cnn.Execute ("update 工资表 set 职务津贴=初始值 from 工资公式表 where 项目名称='职务津贴'and 工资表.所属工资月份=(select 月份 from 月份表)")
  584.     Cnn.Execute ("update 工资表 set 旷工费=初始值 from 工资公式表 where 项目名称='旷工费'and 工资表.所属工资月份=(select 月份 from 月份表)")
  585.     Cnn.Execute ("update 工资表 set 惩罚总额=惩罚金额 from 员工惩罚表 where 工资表.员工编号=员工惩罚表.员工编号 and 工资表.所属工资月份=员工惩罚表.所属工资月份")
  586.     Cnn.Execute ("update 工资表 set 养老保险=初始值 from 工资公式表 where 项目名称='养老保险'and 工资表.所属工资月份=(select 月份 from 月份表)")
  587.     Cnn.Execute ("update 工资表 set 失业保险=初始值 from 工资公式表 where 项目名称='失业保险'and 工资表.所属工资月份=(select 月份 from 月份表)")
  588.     Cnn.Execute ("update 工资表 set 医疗保险=初始值 from 工资公式表 where 项目名称='医疗保险'and 工资表.所属工资月份=(select 月份 from 月份表)")
  589.     Cnn.Execute ("update 工资表 set 应发工资=基本工资+工龄工资+加班费+全勤奖+奖励总额+职务津贴 where 工资表.所属工资月份=(select 月份 from 月份表)")
  590.     Cnn.Execute ("update 工资表 set 应扣工资=旷工费+惩罚总额+养老保险+失业保险+医疗保险 where 工资表.所属工资月份=(select 月份 from 月份表)")
  591.     Cnn.Execute ("update 工资表 set 实发工资=应发工资-应扣工资 where 工资表.所属工资月份=(select 月份 from 月份表)")
  592.     Adodc1.Refresh
  593.   End If
  594.   rs1.Close
  595.   
  596.   
  597.   Dim fld
  598.   For Each fld In Adodc1.Recordset.Fields
  599.      '如果字段类型为"货币",则格式化该列
  600.      If fld.Type = 6 Then
  601.         Dim f1 As StdDataFormat
  602.         Set f1 = DataGrid1.Columns(fld.Name).DataFormat
  603.         f1.Format = "##,##0.00"
  604.      End If
  605.   Next
  606. End Sub
  607. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  608.   sql1 = ""
  609. End Sub
  610. Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
  611.   Select Case Button.Key
  612.      Case "all"
  613.        If Toolbar1.Buttons(1).Caption = "当前月份" Then
  614.           Toolbar1.Buttons(1).Caption = "所有月份"
  615.        Else
  616.           Toolbar1.Buttons(1).Caption = "当前月份"
  617.        End If
  618.        If Toolbar1.Buttons(1).Caption = "所有月份" Then
  619.          If sql1 <> "" Then
  620.            Adodc1.RecordSource = "select * from 工资表 " & sql1 & " order by 所属工资月份,员工编号"
  621.            Adodc1.Refresh
  622.          Else
  623.            Adodc1.RecordSource = "select * from 工资表 order by 所属工资月份,员工编号"
  624.            Adodc1.Refresh
  625.          End If
  626.        Else
  627.          If sql1 <> "" Then
  628.            Adodc1.RecordSource = "select * from 工资表 " & sql1 & "and 工资表.所属工资月份=(select 月份 from 月份表) order by 所属工资月份,员工编号"
  629.            Adodc1.Refresh
  630.          Else
  631.            Adodc1.RecordSource = "select * from 工资表 where 工资表.所属工资月份=(select 月份 from 月份表) order by 所属工资月份,员工编号"
  632.            Adodc1.Refresh
  633.          End If
  634.        End If
  635.      Case "modify"
  636.        If Adodc1.Recordset.RecordCount > 0 Then
  637.          Load main_gzgl_gzgl_lr
  638.          main_gzgl_gzgl_lr.Show 1
  639.        Else
  640.          MsgBox "系统没有要修改的数据!", , "提示窗口"
  641.        End If
  642.      Case "allmodify"
  643.        If Adodc1.Recordset.RecordCount > 0 Then
  644.          Load main_gzgl_gzgl_pl
  645.          main_gzgl_gzgl_pl.Show 1
  646.        Else
  647.          MsgBox "系统没有要修改的数据!", , "提示窗口"
  648.        End If
  649.      Case "find"
  650.        tb1 = "工资表"
  651.        Load main_fzfind
  652.        main_fzfind.Show 1
  653.      Case "excel"
  654.        Dim r As Integer, c As Integer
  655.        Dim newxls As Excel.Application
  656.        Dim newbook As Excel.Workbook
  657.        Dim newsheet As Excel.Worksheet
  658.        Set newxls = CreateObject("Excel.Application") '创建excel应用程序,打开excel2000
  659.        Set newbook = newxls.Workbooks.Add   '创建工作簿
  660.        Set newsheet = newbook.Worksheets(1) '创建工作表
  661.        If Toolbar1.Buttons(1).Caption = "所有月份" Then
  662.          If sql1 <> "" Then
  663.            Adodc1.RecordSource = "select * from " & sql1 & "order by 所属工资月份,员工编号"
  664.            Adodc1.Refresh
  665.          Else
  666.            Adodc1.RecordSource = "select * from 工资表 order by 所属工资月份,员工编号"
  667.            Adodc1.Refresh
  668.          End If
  669.        Else
  670.          If sql1 <> "" Then
  671.            Adodc1.RecordSource = "select * from " & sql1 & "and 所属工资月份=(select 月份 from 月份表) order by 所属工资月份,员工编号"
  672.            Adodc1.Refresh
  673.          Else
  674.            Adodc1.RecordSource = "select * from 工资表 where 所属工资月份=(select 月份 from 月份表) order by 所属工资月份,员工编号"
  675.            Adodc1.Refresh
  676.          End If
  677.        End If
  678.        If Adodc1.Recordset.RecordCount > 0 Then
  679.          newxls.Visible = True
  680.          For i = 0 To DataGrid1.Columns.Count - 1
  681.               newsheet.Cells(1, i + 1) = DataGrid1.Columns(i).Caption
  682.          Next i
  683.          '指定表格内容
  684.          Adodc1.Recordset.MoveFirst
  685.          Do Until Adodc1.Recordset.EOF
  686.               r = Adodc1.Recordset.AbsolutePosition
  687.               For c = 0 To DataGrid1.Columns.Count - 1
  688.                   newsheet.Cells(r + 1, c + 1) = DataGrid1.Columns(c)
  689.               Next c
  690.               Adodc1.Recordset.MoveNext
  691.          Loop
  692.        End If
  693.      Case "print"
  694.        If Toolbar1.Buttons(1).Caption = "所有月份" Then
  695.          If sql1 <> "" Then
  696.            DE1.rsCommand1.Open "select * from " & sql1 & " order by 所属工资月份,员工编号"
  697.          Else
  698.            DE1.rsCommand1.Open "select * from 工资表 order by 所属工资月份,员工编号"
  699.          End If
  700.        Else
  701.          If sql1 <> "" Then
  702.            DE1.rsCommand1.Open "select * from " & sql1 & " and 所属工资月份=(select 月份 from 月份表) order by 所属工资月份,员工编号"
  703.          Else
  704.            DE1.rsCommand1.Open "select * from 工资表 where 所属工资月份=(select 月份 from 月份表) order by 所属工资月份,员工编号"
  705.          End If
  706.        End If
  707.        DR1_gzdy.Orientation = rptOrientLandscape
  708.        DR1_gzdy.LeftMargin = 200
  709.        DR1_gzdy.RightMargin = 200
  710.        DR1_gzdy.Show 1
  711.      Case "printone"
  712.        If Toolbar1.Buttons(1).Caption = "所有月份" Then
  713.          If sql1 <> "" Then
  714.            DE1.rsCommand2.Open "select * from " & sql1 & " order by 所属工资月份,员工编号"
  715.          Else
  716.            DE1.rsCommand2.Open "select * from 工资表 order by 所属工资月份,员工编号"
  717.          End If
  718.        Else
  719.          If sql1 <> "" Then
  720.            DE1.rsCommand2.Open "select * from " & sql1 & " and 所属工资月份=(select 月份 from 月份表) order by 所属工资月份,员工编号"
  721.          Else
  722.            DE1.rsCommand2.Open "select * from 工资表 where 所属工资月份=(select 月份 from 月份表) order by 所属工资月份,员工编号"
  723.          End If
  724.        End If
  725.        DR1_gzt.Orientation = rptOrientPortrait
  726.        DR1_gzt.Show 1
  727.      Case "close"
  728.        Unload Me
  729.   End Select
  730. End Sub