Click here to Skip to main content
15,886,780 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to make backup and restore in vb

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

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


content has been moved from comment - Maciej Los
[/EDIT]
Posted
Updated 8-Mar-14 9:48am
v2
Comments
Vedat Ozan Oner 7-Mar-14 4:58am    
google it. you will find your answer.
Tejas Vaishnav 7-Mar-14 5:00am    
what thing you are trying to backup and restore...?
is this your database your are talking about...?
then please be clear in your question that your want to backup this thing and then i need to also give restoration functionality.
OriginalGriff 7-Mar-14 5:27am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So give us as much detail as you can - there are many, many things I back up on a regular basis, and it could be any of them!
Use the "Improve question" widget to edit your question and provide better information.

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


[edit] Corrected double quote position[\edit]
 
Share this answer
 
v2
Comments
Maciej Los 8-Mar-14 16:01pm    
Have a look at the code: .mdb, "portf. Replace [,] with ["]. ;)
OriginalGriff 8-Mar-14 16:12pm    
Thanks!
I'm on my tablet and getting code right is a PITA...
Maciej Los 8-Mar-14 16:14pm    
You're welcome, Paul ;)
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[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900