📄 main_gzgl_gqsjcl.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form main_gzgl_gqsjcl
BorderStyle = 3 'Fixed Dialog
Caption = "工资过期数据处理"
ClientHeight = 3300
ClientLeft = 45
ClientTop = 330
ClientWidth = 3705
Icon = "main_gzgl_gqsjcl.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3300
ScaleWidth = 3705
ShowInTaskbar = 0 'False
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 240
Left = 60
TabIndex = 3
Top = 2445
Visible = 0 'False
Width = 3570
_ExtentX = 6297
_ExtentY = 423
_Version = 393216
Appearance = 1
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 390
Left = 1920
TabIndex = 2
Top = 2790
Width = 1305
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 390
Left = 375
TabIndex = 1
Top = 2790
Width = 1305
End
Begin VB.ListBox List1
Height = 2370
Left = 60
Style = 1 'Checkbox
TabIndex = 0
Top = 45
Width = 3570
End
End
Attribute VB_Name = "main_gzgl_gqsjcl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Private Sub Command1_Click()
Dim Counter As Integer '定义一个整型变量
Dim Workarea(250) As String '定义字符串变量
ProgressBar1.Visible = True
ProgressBar1.Max = UBound(Workarea)
ProgressBar1.Min = LBound(Workarea)
'设置进度的值为 Min
ProgressBar1.Value = ProgressBar1.Min
'在整个数组中循环
For Counter = LBound(Workarea) To UBound(Workarea)
'设置数组中每项的初始值
Workarea(Counter) = Counter
ProgressBar1.Value = Counter
For i = 0 To List1.ListCount - 1
If List1.Selected(i) = True Then
cnn.Execute ("delete from 工资表 where 所属工资月份='" & List1.List(i)) & "'"
End If
Next i
Next Counter
ProgressBar1.Visible = False
ProgressBar1.Value = ProgressBar1.Min
End Sub
Private Sub Form_Load()
rs1.Open "select 所属工资月份 from 工资表 group by 所属工资月份", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
rs1.MoveFirst
Do While rs1.EOF = False
List1.AddItem rs1.Fields("所属工资月份")
rs1.MoveNext
Loop
End If
rs1.Close
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -