📄 main_csh.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form main_csh
BorderStyle = 1 'Fixed Single
Caption = "初始化"
ClientHeight = 2160
ClientLeft = 2265
ClientTop = 3765
ClientWidth = 7545
Icon = "main_csh.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2160
ScaleWidth = 7545
StartUpPosition = 1 '所有者中心
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "C:\mrjd\kfgl.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 390
Left = -600
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "kf"
Top = 1200
Visible = 0 'False
Width = 1155
End
Begin VB.CommandButton Comstart
Caption = "开始"
Height = 390
Left = 4020
TabIndex = 7
Top = 1605
Width = 1125
End
Begin VB.CommandButton Comcreat
Caption = "初始化"
Enabled = 0 'False
Height = 390
Left = 5160
TabIndex = 6
Top = 1605
Width = 1125
End
Begin VB.CommandButton Comend
Caption = "退出"
Height = 390
Left = 6300
TabIndex = 5
Top = 1605
Width = 1125
End
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 360
Left = 45
TabIndex = 4
Top = 1635
Visible = 0 'False
Width = 3870
_ExtentX = 6826
_ExtentY = 635
_Version = 393216
Appearance = 1
End
Begin VB.Frame Frame1
Caption = "基础数据"
Enabled = 0 'False
Height = 900
Left = 15
TabIndex = 1
Top = 540
Width = 7455
Begin VB.CheckBox Check5
Caption = "操作员信息"
Height = 240
Left = 5880
TabIndex = 9
Top = 360
Width = 1230
End
Begin VB.CheckBox Check4
Caption = "客房预定信息"
Height = 240
Left = 480
TabIndex = 8
Top = 360
Width = 1455
End
Begin VB.CheckBox Check2
Caption = "客房信息"
Height = 240
Left = 4080
TabIndex = 3
Top = 360
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "客人入住信息"
Height = 240
Left = 2280
TabIndex = 2
Top = 360
Width = 1395
End
End
Begin VB.Label Label1
Caption = "提示:初始化,将清空所选表数据或全部数据。"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 285
Left = 90
TabIndex = 0
Top = 90
Width = 4770
End
End
Attribute VB_Name = "main_csh"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Database '定义数据库
Dim rs As Recordset '定义字段
Dim connter As Integer '定义一个整型变量
Dim workarea(200), sql As String '定义字符串变量
Private Sub Form_Load() '自动识别数据库路径
Data1.DatabaseName = App.Path & "\Kfgl.MDB"
End Sub
Private Sub comstart_Click()
Frame1.Enabled = True: Comcreat.Enabled = True
End Sub
Private Sub comcreat_Click() '清空选定表中的数据
ProgressBar1.Visible = True
ProgressBar1.Max = UBound(workarea)
ProgressBar1.Value = ProgressBar1.Min
For Counter = LBound(workarea) To UBound(workarea)
workarea(Counter) = "initial value " & Counter
ProgressBar1.Value = Counter
Set db = Workspaces(0).OpenDatabase(App.Path & "\Kfgl.MDB")
If Check1.Value = 1 Then
sql = "delete * from djb"
db.Execute sql
End If
If Check2.Value = 1 Then
sql = "delete * from kf"
db.Execute sql
End If
If Check4.Value = 1 Then
sql = "delete * from yd"
db.Execute sql
End If
If Check5.Value = 1 Then
sql = "delete * from qxsz"
db.Execute sql
End If
Next Counter
ProgressBar1.Visible = False
ProgressBar1.Value = ProgressBar1.Min
End Sub
Private Sub comend_Click()
' main.Enabled = True
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -