Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42220

Backup from Remote Computer

$
0
0
Hi

In the below code when i take Backup from remote computer it gives me error "Cannot Open Backup Device 'c:\test.bak' operating system error 5 (Access is denied)
When i run Backup Utility on local computer it works fine

Dim path As String
Dim dbname As String

dbname = “Test”
path = App.path

Dim res As Integer
Set cmd = New ADODB.Command

If confind.State = 1 Then confind.Close
confind.Open "Driver=SQL Server;Server=" & ServerName & ";Database=’TEST’" & ";uid=" & uid & ";pwd=" & pwd & ";"
cmd.ActiveConnection = confind
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "SpBackup"
cmd.Parameters.Append cmd.CreateParameter("dbname", adVarChar, adParamInput, 50, dbname)
cmd.Parameters.Append cmd.CreateParameter("path", adVarChar, adParamInput, 256, path)
cmd.Execute

Thanks

Viewing all articles
Browse latest Browse all 42220

Trending Articles