Calling external sub

Discussion in 'ASP General' started by Marcel, Jan 12, 2006.

  1. Marcel

    Marcel Guest

    Im wanting to call a sub funvtion on another page from vbs that is
    <SCRIPT LANGUAGE=vbscript RUNAT=Server>
    sql="exec SomeStoredProc"
    call DoConnection(sql)
    Response.write(recordset.getstring)
    call DBClose()
    </SCRIPT>

    the DoConnection sub is in another page called MyDBConnection in a folder
    call Common.

    I know that I can use serverside includes and embed my con in the page
    using <%%> but I want the use runat server

    How can I make call to a function in an external page?
     
    Marcel, Jan 12, 2006
    #1
    1. Advertising

  2. Why does it matter? If you want to /include/ a file, you have to /include/
    the file. And that's unrelated to <% %> vs. <script
    runat="server"></script>, since you'd write:

    <!-- #include file="filename.asp" -->

    Ray at home

    "Marcel" <> wrote in message
    news:...
    > Im wanting to call a sub funvtion on another page from vbs that is
    > <SCRIPT LANGUAGE=vbscript RUNAT=Server>
    > sql="exec SomeStoredProc"
    > call DoConnection(sql)
    > Response.write(recordset.getstring)
    > call DBClose()
    > </SCRIPT>
    >
    > the DoConnection sub is in another page called MyDBConnection in a folder
    > call Common.
    >
    > I know that I can use serverside includes and embed my con in the page
    > using <%%> but I want the use runat server
    >
    > How can I make call to a function in an external page?
    >
    >
     
    Ray Costanzo [MVP], Jan 13, 2006
    #2
    1. Advertising

  3. Marcel

    Guest

    And of course one can use functions conditionally from an included
    page.

    >From the calling page:


    <!--#include file="myutilityfunctions.asp"-->

    <%
    Select Case MyVar
    Case MyVar 1
    MyFunction1FromOtherPage()
    Case MyVar 2
    MyFunction2FromOtherPage()
    Case MyVar 3
    MyFunction3FromOtherPage()
    End Select
    %>

    Best regards,
    -Paul
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - ASP Design Tips
     
    , Jan 16, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. THY
    Replies:
    1
    Views:
    413
    Steve C. Orr, MCSD
    Aug 19, 2003
  2. Ben
    Replies:
    2
    Views:
    962
  3. Lawrence D'Oliveiro

    Death To Sub-Sub-Sub-Directories!

    Lawrence D'Oliveiro, May 5, 2011, in forum: Java
    Replies:
    92
    Views:
    2,174
    Lawrence D'Oliveiro
    May 20, 2011
  4. Richard Gration

    Legitimate use of calling a sub as &sub

    Richard Gration, Feb 23, 2005, in forum: Perl Misc
    Replies:
    1
    Views:
    138
    Brian McCauley
    Feb 23, 2005
  5. Martin Kissner

    Question about sub calling other sub

    Martin Kissner, Mar 4, 2006, in forum: Perl Misc
    Replies:
    8
    Views:
    123
    Martin Kissner
    Mar 9, 2006
Loading...

Share This Page