This is a public Media Gallery  publicRSS

Action

    Query Database and Send results via e-mail...
    Action posted 11/13/09 by Zachary Loeber
    1606 Views, 4 Comments
    Name:
    Query Database and Send results via e-mail (optionally update the records as well)
    Description:

    This is a good compliment to the sql query active monitor. It will open a connection to a remote database first. If there are results it will then compose and e-mail and shoot it out to whom ever you specify in the variables at the top of the code.

    Optionally you can update the table values returned as well. I use this to help automate some internal processes but there are many uses for such functionality in the hands of a creative scripter.

    Language:
    VB Script
    Code:
    Disclaimer:
    All scripts found on wugSpace are provided as-is with no warranty or guarantee. These scripts are not supported by Ipswitch Technical Support. If you have a problem with this script, please ask any questions in the comments.

    Comments

    • posted Apr 27 by Slopium Granitae

      I'm getting declare variable errors with each variable. Can you include more?

      Reply to this Comment

    • posted Apr 27 by Zachary Loeber

      Are you certain you are defining it as an action script and not an active monitor?

      Reply to this Comment

    • posted Apr 27 by Slopium Granitae

      Ah, I was doing something silly. I'm still new to all this, and I don't know much about VB.

      Now it is only timing out, I don't think I have setup the objConnection.Open correctly. Or maybe this won't work with the Stock MSDE 2000 database that came with my version of What's Up(2006).

      Thank you for responding, especially so quickly.

      Reply to this Comment

    • posted Apr 27 by Zachary Loeber

      It is nice to see someone get some use out bits of my hackery :)

      If the mydatabaseserver has been replaced correctly it should just work but I've not tested w/ a default instance of sql 2000 yet so you may have to google out the proper connection string.

      Reply to this Comment