Click here to Skip to main content
15,879,184 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi to All,

How to Backup .mdb file Using .Net Windows Application.

Help me...
Posted

Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...
Your question subject:
http://www.google.co.uk/search?gcx=w&sourceid=chrome&ie=UTF-8&q=Backup+.mdb+File+Using+.Net+Windows[^]
Found:
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/0dacf318-24fa-4962-91b5-69a246c6684d/[^]
 
Share this answer
 
Try this code :
VB
Public Sub BackUpInformation()
        Source = Application.StartupPath & "\DataBaseName.mdb"       'Path where DataBase actually Stored
        Path = "New Path to Save Backup"                
        If GetPath.ToString = "" Then       'If Path is Not set
            'Do Nothing
        Else                                'If Path is set
         Try
           File.Copy(Source, Path & "\DataBaseNameBackUp.mdb", True)  'Copying file to the Destination
         Catch ex As Exception
           MessageBox.Show(ex.ToString)     'Providing Error Message
         End Try
        End If
    End Sub

I hope it will help you. :)
 
Share this answer
 
Comments
fjdiewornncalwe 1-Dec-11 11:32am    
You can't just copy the mdb file. You have to first make sure that the db is not in use if you want to do it this way which will require shutting down the SQL Server, or Access server depending on which is being used.
Zoltán Zörgő 29-Sep-12 16:30pm    
Sorry, Access server? What's that?
Manoj K Bhoir 30-Sep-12 23:54pm    
So Do One thing. Before Calling this Method Just Close the Data Base Connection If it is Open. I hope you know how to do this. :)
 
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