Results 1 to 9 of 9

Thread: [RESOLVED] ASP, VB Script

  1. #1

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,562

    Resolved [RESOLVED] ASP, VB Script

    Okay, so this forum is named "ASP, VB Script". My question is, how do an asp file and a vbs file usually interact?

    I am working on email triggers. I am maintaining an ASP application and migrating it to .NET. The trigger functionality doesn't work too well in ASP which makes my job a little bit difficult, not to mention there is no documentation and I get emails like this from the original programmer:
    in any event the triggers fro resales which i can't recall what it is is pretty much the trigger code to run each night. you can probably get it into a compiled from easily and make it work with even the existing trigger setup with some mode i'm sure.



    But he did point me to the directory structure containing two files, Send_Nightly_Triggers.asp and Send_Nightly_Triggers.vbs. So my question is, how do these two files interact? For example, I searched for Select_NYMEX_Averages and I found this in both files:
    (asp)
    Line 40 : Call Select_NYMEX_Averages()
    Line 88 : Sub Select_NYMEX_Averages()
    (vbs)
    Line 75 : Call Select_NYMEX_Averages()
    Line 123 : Sub Select_NYMEX_Averages()

    How do I start walking through this code - with the vbs or the asp? Which one runs first? What else do I need to know about this architecture?

    Thanks - I know I'll get more help on this forum than I would talking to anyone that works for my company!

  2. #2
    New Member
    Join Date
    May 2009
    Posts
    9

    Re: ASP, VB Script

    ASP runs only through IIS, VBScript runs through windows scripting host. You can run a VBScript using a scheduled task, which could be why the old programmer may have 2 ways of doing the same thing. Or...the asp file could be to populate a database, which the VBScript file could see when it's run as a scheduled task.

    Hope this helps...

  3. #3

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,562

    Re: ASP, VB Script

    Thank you, yes that is helpful. The files are practically identical except one updates the database, one doesn't (the latter has the update code, but it is commented out) so obviously it's an either/or and not both situation. I think the programmer may have had the ASP code so he could debug it - is it true it's easier to debug than a scheduled task written in vbs?

    Anyway, I think I'll be writing a windows service since it has to check the database once every 24 hours to see if it needs to act on any data and generate emails.

    Thanks.

  4. #4
    New Member
    Join Date
    May 2009
    Posts
    9

    Re: ASP, VB Script

    It is easier for me to debug with ASP, and with a task that needs to run every 24 hours, I would have moved it to vbs also.

    Good luck!

  5. #5

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,562

    Re: ASP, VB Script

    I am on the forum because I have posted a few questions to this forum recently and wanted to wrap them up and I also found this from 10 months ago. Anyway, I have been working with VBS files a lot recently and know much more about them now. So I will mark this resoved too. Thanks.
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  6. #6
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Re: [RESOLVED] ASP, VB Script

    VBScript is actually pretty easy to debug. At the command line type something like this

    wscript "C:\Documents and Settings\Mark\script_name.vbs" //d //x

    This tells the windows script host to run this scirpt in debug mode and break on the first line of code. You can then step through the code and see what you have.

  7. #7

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,562

    Re: [RESOLVED] ASP, VB Script

    Oh, thanks. I am working with VBS some more right now. Most of the scripts are scheduled tasks and I get no error there. When I run it from a command prompt I get the error (it's a dialog). Your way will be even more useful.
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  8. #8
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Re: [RESOLVED] ASP, VB Script

    If you are running 64-bit make sure you are using the correct scripting host. Also try /? to make sure that that d and x are still the correct parameters.

  9. #9

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,562

    Re: [RESOLVED] ASP, VB Script

    Quote Originally Posted by MarkT View Post
    make sure you are using the correct scripting host
    Yes! I learned that the hard way!
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width