📄 main_sjbf.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form main_sjbf
BorderStyle = 1 'Fixed Single
Caption = "数据备份"
ClientHeight = 1785
ClientLeft = 45
ClientTop = 330
ClientWidth = 5820
Icon = "main_sjbf.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 1785
ScaleWidth = 5820
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 4560
TabIndex = 3
Top = 1320
Width = 1120
End
Begin VB.CommandButton Command1
Caption = "备份"
Height = 375
Left = 3360
TabIndex = 2
Top = 1320
Width = 1120
End
Begin VB.Frame Frame1
Caption = "进度显示"
Height = 1095
Left = 120
TabIndex = 0
Top = 120
Width = 5535
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 495
Left = 240
TabIndex = 1
Top = 360
Width = 5055
_ExtentX = 8916
_ExtentY = 873
_Version = 393216
Appearance = 1
End
End
End
Attribute VB_Name = "main_sjbf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim workarea(6) As String '定义字符串变量
Dim str1 As String
Dim str2 As String
Dim char As Byte
Private Sub Command1_Click()
A = MsgBox("确定备份数据?", 4, "系统提示")
If A = vbYes Then
Command1.Enabled = False
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
Open str1 For Binary As #1
Open str2 For Binary As #2
Do While Not EOF(1)
Get #1, , char
Put #2, , char
Loop
Close
Next Counter
ProgressBar1.Value = ProgressBar1.Min
MsgBox "数据库备份成功!", , "系统提示"
Command1.Enabled = True
End If
End Sub
Private Sub Command2_Click()
Main.Enabled = True
Unload Me
End Sub
Private Sub Form_Load()
str1 = App.Path & "\db_kfgl.mdb"
str2 = App.Path & "\数据库备份\db_kfgl.mdb"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -