Using ntBackup

G

Guest

I have a cmdbutton on a form which opens up ntbackup. the code is below and
all works fine. when ntbacup opens it opens it main menu where you can select
backup / restore / restore and manage media. then the user has to click on
several cmds to finally get a backup done. Is there any VBA code that will
open ntbackup and automatically take it through its steps with out the user
having to do anything??


Private Sub cmdBackupDatabase_Click()
On Error GoTo Err_cmdBackupDatabase_Click

Dim stAppName As String

stAppName = "C:\WINDOWS\system32\ntbackup.exe"
Call Shell(stAppName, 1)

Exit_cmdBackupDatabase_Click:
Exit Sub

Err_cmdBackupDatabase_Click:
MsgBox Err.Description
Resume Exit_cmdBackupDatabase_Click

End Sub
 
D

David Lloyd

The following KB article may be a useful reference.

http://support.microsoft.com/default.aspx?scid=kb;en-us;814583

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


I have a cmdbutton on a form which opens up ntbackup. the code is below and
all works fine. when ntbacup opens it opens it main menu where you can
select
backup / restore / restore and manage media. then the user has to click on
several cmds to finally get a backup done. Is there any VBA code that will
open ntbackup and automatically take it through its steps with out the user
having to do anything??


Private Sub cmdBackupDatabase_Click()
On Error GoTo Err_cmdBackupDatabase_Click

Dim stAppName As String

stAppName = "C:\WINDOWS\system32\ntbackup.exe"
Call Shell(stAppName, 1)

Exit_cmdBackupDatabase_Click:
Exit Sub

Err_cmdBackupDatabase_Click:
MsgBox Err.Description
Resume Exit_cmdBackupDatabase_Click

End Sub
 
G

Guest

Thanks for your reply, Access2003 doesnt seem to support ntbackup.

do you know what is the easyiest way for the end user to create a backup of
the database??
 
D

David Lloyd

Apparently, I do not understand exactly what you are trying to do. You can
use the command line parameters in the referenced KB article with the Shell
command to automate the NTBackup process. This is what I thought you were
asking. For example:

Function test45()
On Error GoTo Err_cmdBackupDatabase_Click

Dim stAppName As String

stAppName = "C:\WINDOWS\system32\ntbackup.exe backup c:\test1 /j 'Test
Backup' /f 'H:\Test2\TestBackup.bkf' "
Call Shell(stAppName, 1)

Exit_cmdBackupDatabase_Click:
Exit Function

Err_cmdBackupDatabase_Click:
MsgBox Err.Description
Resume Exit_cmdBackupDatabase_Click

End Function

If you just want to backup the Access database, there is an option on File
menu for "Back Up Database" which allows the user to back up the Access
database.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Thanks for your reply, Access2003 doesnt seem to support ntbackup.

do you know what is the easyiest way for the end user to create a backup of
the database??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top