sp_Start_Job confuses job_id with job_name?
From: Jochen Schug (Jochen_Schug_at_HMSoftware.de)
Date: 05/24/04
- Next message: Daniel: "Method 'Value' of object '_TextBox' failed ???????????????"
- Previous message: Carl Prothman [MVP]: "Re: Server slowly hangs using ADOR and VB"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 24 May 2004 12:08:12 -0400
// database objects
var objCONN = Server.CreateObject("ADODB.Connection");
var objCMD = Server.CreateObject("ADODB.Command");
// database constants
var dbDSN = "Provider=SQLOLEDB;Server=...;Database=msdb;UID=sa;PWD=...";
var dbSQLStart = "sp_Start_Job";
// open the connection
objCONN.Open( dbDSN );
// run the stored procedure
objCMD.ActiveConnection = objCONN;
objCMD.CommandText = dbSQLStart;
objCMD.CommandType = adCmdStoredProc;
objCMD.CommandText = dbSQLStart;
objCMD.Parameters.Append( objCMD.CreateParameter( "@job_id", adGUID,
adParamInput, 0,
'{298C5BB8-9897-4615-AC22-B62CA7B522DD}' ) );
objCMD.Execute();
results in:
Microsoft OLE DB Provider for SQL Server error '80040e14'
The specified @job_name ('298C5BB8-9897-4615-AC22-B62CA7B522DD') does not
exist.
However, I did NOT specify a "job_name", I specified a "job_id"! To confirm
that, I then appended also a "job_name" parameter and I got the correct
error message, that EITHEr job_id OR job_name must be specified.
If I use adCmdText with "EXEC sp_Start_Job @job_id =
'{298C5BB8-9897-4615-AC22-B62CA7B522DD}';" it will work as expected! So,
there is nothing wrong with the data that I'm passing.
- Next message: Daniel: "Method 'Value' of object '_TextBox' failed ???????????????"
- Previous message: Carl Prothman [MVP]: "Re: Server slowly hangs using ADOR and VB"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|