• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • 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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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