Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Job information

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-06-05 : 09:08:46
roy writes "I am trying to use ADO to call some of the system stored procs for SQL server agent Job information and am having a hard time passing the Job_ID (which is a GUID) to the stored proc "sp_Help_Job"... below is an example of the code... the error i get is as follows:

Run-Time error '3704'; Operation is not allowed when the object is closed.

and happens on the EOF/BOF check line...

any ideas what i may be doing wrong here?

cm2.ActiveConnection = cn
cm2.CommandText = "sp_Help_Job"
cm2.CommandType = adCmdStoredProc
Set pm = cm2.CreateParameter("@Job_ID", adGuid, adParamInput, 16, "{6D298C8E-38F8-46DB-98D1-0E18BC7596CF}")
cm2.Parameters.Append pm
rsjob.CursorLocation = adUseClient
rsjob.Open cm2, , adOpenForwardOnly, adLockReadOnly
If Not rsjob.EOF And Not rsjob.BOF Then
MsgBox rsjob("name")
End If


Thanks,

roy taylor"
   

- Advertisement -