'http://technet.microsoft.com/es-es/library/ms186757.aspx
'http://technet.microsoft.com/es-es/library/ms186757(SQL.90).aspx
Private Sub CmdJob_Click()
On Error GoTo xError
Dim Cnn As New Connection
Dim Rs As New Recordset
Dim cnnStr As String
cnnStr = "Driver={SQL Server};Server=(local);Database=msdb;Uid=sa;Pwd=44444;"
Cnn.Open cnnStr
Cnn.Execute "Exec sp_start_job 'dbWC01Bkp'", Cnn '// 'dbWC01Bkp' Nombre de la tarea
xError:
If Err.Number <> 0 Then
Select Case Err.Number
Case -2147352571
MsgBox "La tarea se inicio con exito", vbInformation, "Exito"
Case Else
MsgBox Err.Description, vbCritical, "Error: " & Err.Number
End Select
Err.Clear
End If
Rs.close
Cnn.close
Set Cnn=Nothing
Set Rs=Nothing
End Sub