Announcement

Collapse
No announcement yet.

Calling VB Script from an ASP Page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Calling VB Script from an ASP Page

    I have a little stumper that I can not seem to get around.

    I currently have a lengthy VB script that parses out files in a file folder looking for certain data and then pumps this parsed data into a database. I can run the script from the events window and pass ("main","directorynamehere") and away the script run looking in the "directorynamehere" folder for the html files and parses them out.

    Unfortunately, this is not at all WAF friendly, as you have to manually edit the event for every different folder that she would like parsed, so out came an ASP page. The first ASP page called "Search" asks the usual question of where to look and then when pressing "GO" it passes over to "Launch_VB.asp" which calls RunEX.
    As you can see, the RunEx command is shown below.
    hs.RunEx "StripDesigns.vb","getmain",Request.Form("HTML_Loc")

    According to the event logs, it is attempting to run the VB script, however it returns and "Error 3 - Running script StripDesigns.vb :method not found". I suspect that it is just a configuration issue in passing the parameters, but I am at a loss as to what else to try.

    The VB script has been configured as
    Function GetMain(ByVal UserDirGroup as string)
    and also as
    Sub GetMain(ByVal UserDirGroup as string)
    with no success either way.

    Any thoughts.

    #2
    First of all I do not think that the call Request.Form("HTML_Loc") will work in the RunEX function because Request.Form("HTML_Loc") is an HTML form request. Why not simplify and simply move the vb script code into the asp page and allow the asp to do all the work?
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      The VB code has been finallized and I really wanted to avoid moving it. I am getting better at programming every task I take on.

      In regards to the call request, that was one of the things I moved around, and yes you were correct, it will not work as such. However, here is the workaround for that part.

      Html_loc = Request.Form("HTML_Loc")
      and then I used Html_loc in the RunEx command.

      2nd problem, which stopped me from even working directly from the vb script. I had seen one of your previous posts that mentioned trying to use a function as opposed to a sub. So I thought, Rupp is good source of knowledge with a few gazillion posts, so I changed it to a function.
      Unfortunately changing it back to a Sub created the same error.

      It all came down to the fact that I called it "main" and not "Main" as in the actual VB script.

      Case Sensitive - GOTTA LOVE IT !!!!!!!!!!

      Good news - I can call the VB script from an ASP page, passing along my one parameter.

      Thanks Rupp.

      Comment


        #4
        Glad you got it working.
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment

        Working...
        X