如何在vb中进行备份和恢复 [英] how to make backup and restore in vb

查看:104
本文介绍了如何在vb中进行备份和恢复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在vb中进行备份和恢复





这是我的备份代码,但我不知道如何开始恢复备份?

备份按钮



how to make backup and restore in vb


this my code for backup but i dont know to how to start for restoring a backup?
Backup button

Dim portfolioPath As String = My.Application.Info.DirectoryPath 
FileCopy(portfolioPath & "\patientrecord.mdb", "D:\Backup\patientrecord.mdb") 
MsgBox("Backup Successful")





内容已从评论 - Maciej Los

[/ EDIT]



content has been moved from comment - Maciej Los
[/EDIT]

推荐答案

交换源和目的地...

Swap the source and destination over...
Dim portfolioPath As String = My.Application.Info.DirectoryPath
FileCopy("D:\Backup\patientrecord.mdb", portfolioPath & "\patientrecord.mdb")





更正双引号位置[\ edit]



[edit] Corrected double quote position[\edit]


如果你在谈论备份和恢复Access数据库(MDB) [ ^ ],你很接近找到解决方案,因为你正在使用类似这样的方法:如何在vb.net中备份ms访问数据库? [ ^ ]



但是......我建议您使用MS Access 压缩数据库 [ ^ ]方法。如果您想访问MS Access应用程序的其他方法,请参阅:如何从Visual Basic .NET自动执行Microsoft Access [ ^ ]
If you're talking about Back up and restore an Access database (MDB)[^], you're quite close to find a solution, because you're using the method similar to this: How to backup ms access database in vb.net?[^]

But... I would suggest you to use MS Access Compact Database[^] method. If you would like to access to the other methods of MS Access application, please refer this: How To Automate Microsoft Access From Visual Basic .NET[^]


这篇关于如何在vb中进行备份和恢复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆