• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

Return message after sql processed

Hi i have


Set con = Server.CreateObject("ADODB.Connection")
con.open Session("BSGLABDB")

Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = con

cmd.CommandText = "sp_start_job"
cmd.CommandType = &H0004 ' = adCmdStoredProc
cmd.CreateParameter "@job_name"
cmd.Parameters("@job_name") = "Test"
cmd.Execute

Set cmd = Nothing
con.Close
Set con = Nothing

how can i return message telling user this worked.
i can do response.write "finished" but i want to do this if the job actually ran.
Thanks


0
TRACEYMARY
Asked:
TRACEYMARY
  • 2
2 Solutions
 
jitgangulyCommented:
On error Resume Next

Set con = Server.CreateObject("ADODB.Connection")
con.open Session("BSGLABDB")

Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = con

cmd.CommandText = "sp_start_job"
cmd.CommandType = &H0004 ' = adCmdStoredProc
cmd.CreateParameter "@job_name"
cmd.Parameters("@job_name") = "Test"
cmd.Execute

If err.number = 0 ' Then its processed
      Response.Write "Processed"
end if
Set cmd = Nothing
con.Close
Set con = Nothing

0
 
TRACEYMARYAuthor Commented:
Great Thanks a lot...works beautifully.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now