sp_Start_Job confuses job_id with job_name?

From: Jochen Schug (Jochen_Schug_at_HMSoftware.de)
Date: 05/24/04


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.



Relevant Pages

  • Error 80040e14
    ... I have a simple Stored Procedure and all it does is it adds 4 ... Microsoft OLE DB Provider for SQL Server ...
    (microsoft.public.sqlserver.programming)
  • VSS Errors using NTBackup
    ... Microsoft OLE DB Provider for SQL Server ... Error message: ...
    (microsoft.public.windows.server.sbs)
  • Re: [DBNETLIB][ConnectionRead (WrapperRead()).]General network error.
    ... Microsoft OLE DB Provider for SQL Server error '80004005' ... Check your network documentation. ... Microsoft OLE DB Provider for ODBC Drivers error '80004005' ...
    (microsoft.public.inetserver.asp.db)
  • Re: OLE DB Error 999 "Object Was in Use"
    ... Steven Bras wrote: ... Microsoft OLE DB Provider for SQL Server ...
    (microsoft.public.data.ado)
  • Re: linked tables
    ... > Microsoft OLE DB Provider for ODBC Drivers ... then access the Jet table with a 4-part name ... provider, instead of the one for Jet. ... table defined in the Access database which is linked to a SQL Server ...
    (microsoft.public.vb.database.ado)

Loading