Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# VB.NET
Hi to All,
 
How to Backup .mdb file Using .Net Windows Application.
 
Help me...
Posted 30-Nov-11 21:51pm
Rate this: bad
good
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:
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/[^]
  Permalink  
Rate this: bad
good
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
         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. Smile | :)
  Permalink  
Comments
Marcus Kramer at 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ő at 29-Sep-12 16:30pm
   
Sorry, Access server? What's that?
Manoj K Bhoir at 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
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  

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

  Print Answers RSS
0 DamithSL 265
1 CPallini 235
2 OriginalGriff 233
3 Maciej Los 195
4 George Jonsson 170
0 OriginalGriff 5,305
1 DamithSL 4,382
2 Maciej Los 3,760
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,901


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

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