Private Sub munSJBF_Click() On Error GoTo ERR_line newname = App.Path & "/data/data.cc" datapath = App.Path & "/backup/" & Date & " 备份卡.bak" FileCopy newname, datapath MsgBox "数据已备份到 " & datapath, 64, "提示" Exit Sub ERR_line: MsgBox "不能完成数据备份!", 48, "运行错误" End Sub Private Sub munSJHY_Click() On Error GoTo ERR_line Me.CommonDialog1.ShowSave snewname = Me.CommonDialog1.FileName sdatapath = App.Path & "/data/data.cc" If snewname <> "" Then If MsgBox("还原后将覆盖原有数据,确定还原吗?", vbInformation + vbYesNo, "提示") = vbYes Then FileCopy sdatapath, snewname ’
vb备份代码
最新推荐文章于 2021-01-25 11:38:42 发布