help me to backup and restore access database

  • 12 years ago

    Hi there ! i miss u all

    now i need somebody to help me ,

    i need some code and link website, how to backup and restore access database

    but the way that i want to do is no need to copy Database file for back up or retore .

    best regard from

    nimol men

  • 12 years ago

    Since an Access database is just an mdb file, you could use the methods in the System.IO.File namespace to copy it.

    http://msdn.microsoft.com/en-us/library/system.io.file.copy.aspx 

     

  • 12 years ago

    Yes thanks TimLBig Smile

    i just find a better way

    + backup Database

    Function Chomlong_Database(ByVal [sSourceFile] As String, ByVal [sDestination] As String) As String

    Try

    Dim JRO As JRO.JetEngine

    JRO = New JRO.JetEngine

    JRO.CompactDatabase("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & [sSourceFile] & ";Jet OLEDB:Database Password=hello", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & [sDestination] & ";Jet OLEDB:Database Password=hello")

    Return "True"

    Catch ex As Exception Return ex.Message

    Exit Function

    End Try

    End Function

     

    + Restore Database

    i accept you to copy file database to over write old database

     Thanks a lot ..

  • 12 years ago

    Yes - that looks like a better solution since you are also compacting the database with that command.

    Tim 

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity.” - Dennis Ritchie