KB-27260: Backing up a database with E3.

Question:

How can I back up a database via E3?

Solution:

To do so, there are two possibilities:

1. In an Access database, copy the file corresponding to the database manually.
2. In an SQL database, create a button on screen and, in its Click event, insert a script that sends a command to the SQLServer to execute the backup. For example:

‘Creates the database backup object:

‘Refers the ActiveX:
Set Server = CreateObject(“SQLDmo.SqlServer”)

‘Enables login verification and creates a secure connection:
Server.LoginSecure = True
Server.Connect SQLServer

‘Effective BackUp:
Set objBackup = CreateObject(“SQLDMO.Backup”)

‘Sets up properties:
objBackup.BackupSetName  = ArqBackUpName
objBackup.Database       = BDName
objBackup.Action         = “0”
objBackup.BackupSetDescription = BackupSetDescription
objBackup.Files        = ArqBackUpName & “.bak”
objBackup.TruncateLog  = “0”
objBackup.Initialize   = True
objBackup.SQLBackup Server

‘Disconnects from SQL server:
Server.disconnect

‘clean up
set Server = nothing
set objBackup = Nothing

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *