ProgressBar的使用
Option ExplicitDim workarea(6) As String '定义字符串变量
Dim str1 As String
Dim str2 As String
Dim char As Byte
Private Sub Command1_Click()
Dim A, Counter
str1 = App.Path & "\db_kfgl.mdb"
str2 = App.Path & "\数据库备份\db_kfgl.mdb"
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) 当 Counter=0时 不是已经把数据1中的记录全读到2中了吗,那下次执行 Counter=1,2...5不都是在覆盖0的操作吗,我说的
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()
Unload Me
End Sub