1 Replies - 220 Views - Last Post: 18 December 2017 - 03:21 AM Rate Topic: -----

#1 justineb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 17-December 17

Auto backup ms access using vb.net

Posted 17 December 2017 - 07:21 PM

Hi guys i'm just a beginner in VB.net, i try my best to do a Auto back ms access in vb.net but still my progress is not good. I have here a code for backup only. i would like to ask if how can i convert this back up codes to auto backup codes. i hope you can help me for my program.

    Private Sub btnbackup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbackup.Click
            Dim fbd As New FolderBrowserDialog
            If fbd.ShowDialog() = vbOK Then
                File.Copy(Path.Combine(dbpath, "Data", "MHC.mdb"),
                Path.Combine(fbd.SelectedPath, String.Format("MHC{0}.mdb", Date.Now.ToString("yyyyMMdd_hhmmss"))))
            End If
        Catch ex As Exception
        End Try
    End Sub

Is This A Good Question/Topic? 0
  • +

Replies To: Auto backup ms access using vb.net

#2 andrewsw  Icon User is online

  • blow up my boots
  • member icon

Reputation: 6444
  • View blog
  • Posts: 26,064
  • Joined: 12-December 12

Re: Auto backup ms access using vb.net

Posted 18 December 2017 - 03:21 AM

You haven't said how often want to backup. Assuming it is daily then it is best to create a Windows Task (Task Scheduler) to do this, using a simple script file such as VBScript.

It is also preferable that the file not be in use, so after work hours would be best.

(I would also test a backup regularly.)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1