-
July 14th, 2011, 08:52 AM
#1
backup database
i got this code from the internet, but i dont know the process or flow of it, im looking for a button that can restore and save my sql database.
i have backup.bat and restore.bat in a folder..
but i dont know how to use them.
Code:
Private Sub cmdbackup_Click()
If MsgBox("Please confirm creating back-up.", vbQuestion + vbYesNo, "") = vbYes Then
Shell App.Path & "\Backup\backup.bat"
MsgBox "Backup successfully created!", vbInformation
End If
End Sub
Private Sub cmdRestore_Click()
If MsgBox("Please confirm restoring back-up.", vbQuestion + vbYesNo, "") = vbYes Then
Shell App.Path & "\Backup\restore.bat"
MsgBox "Backup successfully restored!", vbInformation
End If
End Sub
Last edited by jelopy15; July 14th, 2011 at 09:00 AM.
-
July 14th, 2011, 09:34 AM
#2
Re: backup database
So what part of it do you not understand. The code is pretty simple. All it does it executes the bat files. In order for it to work as is the bat files must be contained in a sub folder named \backup off the main folder where your program resides.
Assuming the bat files work then the program should work fine.
The success message boxes are bogus though. They may well display before the backup is completed and they have no way of knowing if the procedure was successful or not.
Always use [code][/code] tags when posting code.
-
July 14th, 2011, 09:42 AM
#3
Re: backup database
Really depends on the TYPE of Database. SQL Server / Access / MySQL
-
July 14th, 2011, 09:59 AM
#4
Re: backup database
im using mysql.
for example, im going to press the backup button..then its going to save it in the backup.bat..am i right? then,, does it mean that if i delete my database in mysql can i still recover them by just pressing the restore button?
-
July 14th, 2011, 12:20 PM
#5
Re: backup database
We have no idea what your bat file does so we can not tell you. The code you posted simply executes a bat file and says it worked regaurdless of what actually happens during execution of the bat file.
Always use [code][/code] tags when posting code.
-
July 14th, 2011, 03:22 PM
#6
Re: backup database
There is probably a CONSOLE command, or PROC that will do what you want. Most of us don't do MySQL. Access / Microsoft SQL Server (or Express) is the normal db
-
July 14th, 2011, 11:40 PM
#7
Re: backup database
I would think that the bat file is simply calling a console command.
Always use [code][/code] tags when posting code.
-
July 15th, 2011, 01:20 AM
#8
Re: backup database
What worries me here is because the code was found on the internet, perhaps the bat files are set up wrongly for jelopy. I'd suggest to jelopy that he post the contents of the batch files here. You could do this by right clicking on the Bat file, and selecting Edit. It should open in Notepad. Show us what is insde them, please, just to be safe...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|