Click here to Skip to main content
13,589,266 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi to All,

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

Help me...
Posted 30-Nov-11 20:51pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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:[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Try this code :
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
           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. :)
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. :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 3


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.180615.1 | Last Updated 29 Sep 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100