hi good afternoon,

hi good afternoon,
               am creating one point of sale software in vb.net ,today only i realize that i need a backup for the database i have attached with this project,after change my project as executable file how can i or my clients can take the backup for that database please send me the coding ..i am creating project with vb.net2010 and ms access 2007 database...thank you

Edited by pritaeas: Moved to VB.NET

4 Years
Discussion Span
Last Post by Minimalist

after make the project as exe file i need to take the auto backup for my database how can i write the coding for that


feature of the system that can backup and restore the database by clicking a button please send me the coding


O.K. You can't just have one button to do the backup and restore at the same time. This doesn't make sense. So you need either 2 buttons, one to backup and one to restore or set a flag with a radiobutton or something else.
OK. this what I do: At the first use of my program I createall the databases and folders the program needs. So on first run I create the backup folder:

Case 14 'create the backupfolder on first run of the program
                My.Computer.FileSystem.CreateDirectory(mypath & "\" & constfoldername & "\" & "Backups") 'create workingfolder in th app directory
                InClass.Label7.Text = "Created Backup Folder"

When it comes to backing files up I first create a folder with todays date and then copy the files the user wants to back up into this folder:

Case 15 'create the backup files
                Dim st As String
                st = Now.ToString("D")

                If My.Computer.FileSystem.DirectoryExists(mypath & "\" & constfoldername & "\" & "Backups" & "\" & st) = False Then
                    My.Computer.FileSystem.CreateDirectory(mypath & "\" & constfoldername & "\" & "Backups" & "\" & st)
                End If

                If My.Computer.FileSystem.FileExists(mypath & "\" & constfoldername & "\" & "Globals" & "\" & "Forms.txt") Then
                    My.Computer.FileSystem.CopyFile(mypath & "\" & constfoldername & "\" & "Globals" & "\" & "Forms.txt", mypath & "\" & constfoldername & "\" & "Backups" & "\" & st & "\" & "Forms.txt", True)
                End If
Votes + Comments
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.