[dba-SQLServer]SQL-DMO backup remote database

Francisco H Tapia my.lists at verizon.net
Thu Apr 24 12:05:56 CDT 2003


Since  you can connect to your db, and instead of doing some trick work with
SQL-DMO, you can carry out the opperation via an ADO command instead...
here is an example (also available in your BOL (books on line) keyword
Backup).

BACKUP [YOURDB] TO  DISK = N'C:\YourPath\YourFilename.bak' WITH  INIT ,
NOUNLOAD ,  NAME = N'YOUR DB BACKUPName',  NOSKIP ,   NOFORMAT

-Francisco
http://rcm.netfirms.com

On Thursday, April 24, 2003 9:26 AM [GMT-8],
Elizabeth <ecarey at myway.com> wrote:

: Hi,
:
: I just joined the list, so I apologize if this topic has been covered.
:
: I have a situation where we have some packaged-off-the-shelf software
: called IRIMS that is using MSDE (version 8) for the backend.  There
: appears to be no backup capabilities written in the software, so I am
: writing some code to handle it - using SQL-DMO (pretty cool stuff).
: We are on Windows 2000 machines, locked down for everyone to the
: power user level.  I do not have access to Enterprise Manager, and
: DBAMgr (freeware) won't install properly without administrator rights
: to the PC.
:
: Now my question is, has anyone been able to get around the problem of
: not being able to backup a remote database? My code snippet:
:
: oServer.LoginSecure = False
: oServer.LoginTimeout = 60
: oServer.Connect "remote_server_name", "sa", ""
: oBackup.Database = gstrDBName
: oBackup.Files = "C:\Temp\" & gstrDBName & gnFileNumber & ".bak"
: oBackup.SQLBackup oServer
:
: This runs fine.  I get no error raised.  I have confirmed my
: connection to the database. The SQLBackup method runs without error,
: it just doesn't create the backup file.  If I connect to the database
: on the remote machine and run the backup command from the "Tools,
: Database Utilities" menu in Access, Access complains that it can only
: backup a database running on the local machine.
:
: Any ideas?
:
: Thanks,
:
: Elizabeth Carey




More information about the dba-SQLServer mailing list