Hello, all!
I'm successfully using SQL DMO to create backups of my SQL database on my local machine. I can connect to our local network and manipulate server databases. Is there a way to create a .bak on my local disk of the server database?
my abbreviated code:
Dim poBackup As SQLDMO.Backup
'Create backup
Set mvSQLServer = New SQLDMO.SQLServer
mvSQLServer.LoginTimeout = 15
mvSQLServer.Connect dbServerName, uid, pwd
Set poBackup = New SQLDMO.Backup
poBackup.Database = DBName
PathToLocal = "C:\somelocaldir
BackupFileName = PathToLocal & "\" & DBName & ".bak"
poBackup.Files = BackupFileName
Again, this works great when I'm backing up a local database. I think I need something like:
PathToLocal = "\\myPCname..."
when I'm backing up from "\\ourNetworkServer\..."
What am I missing?
Thanks
I'm successfully using SQL DMO to create backups of my SQL database on my local machine. I can connect to our local network and manipulate server databases. Is there a way to create a .bak on my local disk of the server database?
my abbreviated code:
Dim poBackup As SQLDMO.Backup
'Create backup
Set mvSQLServer = New SQLDMO.SQLServer
mvSQLServer.LoginTimeout = 15
mvSQLServer.Connect dbServerName, uid, pwd
Set poBackup = New SQLDMO.Backup
poBackup.Database = DBName
PathToLocal = "C:\somelocaldir
BackupFileName = PathToLocal & "\" & DBName & ".bak"
poBackup.Files = BackupFileName
Again, this works great when I'm backing up a local database. I think I need something like:
PathToLocal = "\\myPCname..."
when I'm backing up from "\\ourNetworkServer\..."
What am I missing?
Thanks