?? main_xtgl_xtwh.frm
字號:
VERSION 5.00
Begin VB.Form main_xtgl_xtwh
BorderStyle = 1 'Fixed Single
Caption = "系統管理--系統維護向導"
ClientHeight = 5970
ClientLeft = 45
ClientTop = 330
ClientWidth = 11505
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5970
ScaleWidth = 11505
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Comend
Caption = "取消維護向導"
Height = 360
Left = 4725
TabIndex = 4
Top = 5460
Width = 2100
End
Begin VB.CommandButton Comdown
Caption = "下一步"
Height = 360
Left = 2400
TabIndex = 3
Top = 5460
Width = 2100
End
Begin VB.CommandButton Comup
Caption = "上一步"
Height = 360
Left = 90
TabIndex = 2
Top = 5460
Width = 2100
End
Begin VB.Frame Frame2
Height = 60
Left = 0
TabIndex = 1
Top = 5760
Width = 11520
End
Begin VB.Frame Frame1
Caption = "維護向導的使用規則"
Height = 5070
Index = 0
Left = 3585
TabIndex = 0
Top = 45
Width = 7845
Begin VB.Label Label2
Caption = $"main_xtgl_xtwh.frx":0000
Height = 4800
Left = 195
TabIndex = 6
Top = 240
Width = 7410
End
End
Begin VB.Frame Frame1
Caption = "在下面選擇維護對象"
Height = 4950
Index = 1
Left = 3585
TabIndex = 7
Top = 45
Width = 7845
Begin VB.CheckBox Check1
Caption = "應付帳款歷史信息表"
Height = 315
Index = 7
Left = 165
TabIndex = 24
Top = 4410
Width = 2265
End
Begin VB.CheckBox Check1
Caption = "點單歷史信息表"
Height = 315
Index = 6
Left = 165
TabIndex = 16
Top = 3870
Width = 2265
End
Begin VB.CheckBox Check1
Caption = "結帳歷史信息表"
Height = 315
Index = 5
Left = 165
TabIndex = 15
Top = 3300
Width = 2265
End
Begin VB.CheckBox Check1
Caption = "出貨單據"
Height = 315
Index = 4
Left = 165
TabIndex = 14
Top = 2715
Width = 2265
End
Begin VB.CheckBox Check1
Caption = "進貨單據"
Height = 315
Index = 3
Left = 165
TabIndex = 13
Top = 2115
Width = 2265
End
Begin VB.CheckBox Check1
Caption = "出貨信息表"
Height = 315
Index = 2
Left = 165
TabIndex = 12
Top = 1590
Width = 2265
End
Begin VB.CheckBox Check1
Caption = "進貨信息表"
Height = 315
Index = 1
Left = 150
TabIndex = 11
Top = 1095
Width = 2265
End
Begin VB.CheckBox Check1
Caption = "庫存信息表"
Height = 315
Index = 0
Left = 165
TabIndex = 10
Top = 615
Width = 2265
End
End
Begin VB.Frame Frame1
Caption = "維護項目選擇"
Height = 5070
Index = 2
Left = 3585
TabIndex = 8
Top = 45
Width = 7845
Begin VB.CheckBox Check2
Caption = "清除應付帳款歷史信息"
Height = 315
Index = 7
Left = 165
TabIndex = 25
Top = 4440
Width = 2265
End
Begin VB.CheckBox Check2
Caption = "清除歷史點單信息"
Height = 315
Index = 6
Left = 165
TabIndex = 23
Top = 3900
Width = 2265
End
Begin VB.CheckBox Check2
Caption = "清除歷史結帳單據信息表"
Height = 315
Index = 5
Left = 165
TabIndex = 22
Top = 3330
Width = 2580
End
Begin VB.CheckBox Check2
Caption = "清除一年以前的出貨信單據息"
Height = 315
Index = 4
Left = 180
TabIndex = 21
Top = 2745
Width = 3030
End
Begin VB.CheckBox Check2
Caption = "清除一年以前的進貨單據信息"
Height = 315
Index = 3
Left = 165
TabIndex = 20
Top = 2145
Width = 3075
End
Begin VB.CheckBox Check2
Caption = "清除一年以前的出貨信息"
Height = 315
Index = 2
Left = 165
TabIndex = 19
Top = 1620
Width = 2625
End
Begin VB.CheckBox Check2
Caption = "清除一年以前的進貨信息"
Height = 315
Index = 1
Left = 165
TabIndex = 18
Top = 1125
Width = 3030
End
Begin VB.CheckBox Check2
Caption = "清除庫存小于等于零的信息"
Height = 315
Index = 0
Left = 165
TabIndex = 17
Top = 645
Width = 2670
End
End
Begin VB.Frame Frame1
Caption = "維護結果"
Height = 5070
Index = 3
Left = 3585
TabIndex = 9
Top = 45
Width = 7845
Begin VB.Label Label3
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 4590
Left = 315
TabIndex = 26
Top = 360
Width = 3680
End
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 4965
Left = 45
Picture = "main_xtgl_xtwh.frx":0302
Stretch = -1 'True
Top = 150
Width = 3450
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "請您認真閱讀維護規則,然后按“下一步”"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 225
Left = 7320
TabIndex = 5
Top = 5520
Width = 3735
End
End
Attribute VB_Name = "main_xtgl_xtwh"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i, y As Integer '定義整型變量
Dim newcnn As New Connection '定義數據庫連接
Dim s, SQL0, SQL1, SQL2, SQL3, SQL4, SQL5, SQL6, SQL7 As String '定義字符串變量
Private Sub Form_Activate() '初始化設置
s = Year(Date) - 1
y = 1
Comup.Enabled = False
Me.Caption = Me.Caption & " " & frm_main.St1.Panels(3).text
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True
End Sub
Private Sub Comdown_Click() '下一步操作
If y <> 5 Then y = y + 1
Comup.Enabled = True
If y = 2 Then
Frame1(1).Visible = True: Frame1(0).Visible = False
Frame1(2).Visible = False: Frame1(3).Visible = False
End If
If y > 2 Then
If Check1(0).Value = 0 And Check1(1).Value = 0 And Check1(2).Value = 0 And Check1(3).Value = 0 And Check1(4).Value = 0 And Check1(5).Value = 0 And Check1(6).Value = 0 And Check1(7).Value = 0 Then
MsgBox "請選擇維護對象!"
y = 2
Else
Frame1(2).Visible = True: Frame1(0).Visible = False
Frame1(1).Visible = False: Frame1(3).Visible = False
For i = 0 To 7
If Check1(i).Value = 1 Then Check2(i).Enabled = True Else Check2(i).Enabled = False
Next i
End If
End If
If y > 3 Then
If Check2(0).Value = 0 And Check2(1).Value = 0 And Check2(2).Value = 0 And Check2(3).Value = 0 And Check2(4).Value = 0 And Check2(5).Value = 0 And Check2(6).Value = 0 And Check2(7).Value = 0 Then
MsgBox "請選擇維護項目!"
y = 3
Else
Frame1(2).Visible = False: Frame1(0).Visible = False
Frame1(1).Visible = False: Frame1(3).Visible = True
Comdown.Caption = "開始維護"
End If
End If
If y > 4 Then
newcnn.Open "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=CYGLXT"
If Check2(0).Value = 1 Then
SQL0 = "delete 庫存信息表 where 庫存信息表.庫存數量<=0"
newcnn.Execute SQL0
Label3.Caption = Label3.Caption & "已成功刪除庫存信息表中庫存數量小于等于零的數據!"
End If
If Check2(1).Value = 1 Then
SQL1 = "delete 進貨表 where 進貨表.票號 like '" + s + "'+'%'"
newcnn.Execute SQL1
Label3.Caption = Label3.Caption & "已成功刪除進貨表中一年前的數據! "
End If
If Check2(2).Value = 1 Then
SQL2 = "delete 出貨表 where 出貨表.票號 like '" + s + "'+'%'"
newcnn.Execute SQL2
Label3.Caption = Label3.Caption & "已成功刪除出貨表中一年前的數據! "
End If
If Check2(3).Value = 1 Then
SQL3 = "delete 進貨單據歷史表 where 進貨單據歷史表.進貨票號 like '" + s + "'+'%'"
newcnn.Execute SQL3
Label3.Caption = Label3.Caption & "已成功刪除進貨單據中一年前的數據!"
End If
If Check2(4).Value = 1 Then
SQL4 = "delete 出貨歷史單據表 where 出貨歷史單據表.出貨票號 like '" + s + "'+'%'"
newcnn.Execute SQL4
Label3.Caption = Label3.Caption & "已成功刪除出貨單據中一年前的數據!"
End If
If Check2(5).Value = 1 Then
SQL5 = "delete 結帳歷史信息表 select * from 結帳歷史信息表"
newcnn.Execute SQL5
Label3.Caption = Label3.Caption & "已成功刪除結帳歷史數據! "
End If
If Check2(6).Value = 1 Then
SQL6 = "delete 點單歷史表 select * from 點單歷史表"
newcnn.Execute SQL6
Label3.Caption = Label3.Caption & "已成功刪除點單歷史數據! "
End If
If Check2(7).Value = 1 Then
SQL7 = "delete 付款單據歷史表 select * from 付款單據歷史表"
newcnn.Execute SQL7
Label3.Caption = Label3.Caption & "已成功刪除付款單據歷史數據! "
End If
newcnn.Close
MsgBox "數據維護結束!"
Comdown.Caption = "維護結束"
Comdown.Enabled = False
y = 4
End If
End Sub
Private Sub Comup_Click() '上一步操作
If y <> 1 Then y = y - 1
If y = 1 Then
Frame1(0).Visible = True: Frame1(1).Visible = False
Frame1(2).Visible = False: Frame1(3).Visible = False
End If
If y = 2 Then
Frame1(1).Visible = True: Frame1(0).Visible = False
Frame1(2).Visible = False: Frame1(3).Visible = False
End If
If y = 3 Then
Frame1(2).Visible = True: Frame1(0).Visible = False
Frame1(3).Visible = False: Frame1(1).Visible = False
End If
If y = 4 Then
Frame1(3).Visible = True: Frame1(0).Visible = False
Frame1(2).Visible = False: Frame1(1).Visible = False
End If
If y = 1 Then
Comup.Enabled = False
End If
If y <> 4 Then Comdown.Caption = " 下一步"
End Sub
Private Sub comend_Click()
Unload Me
frm_main.Enabled = True
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -