Help

Discussion in 'ASP General' started by Jose, Feb 23, 2004.

  1. Jose

    Jose Guest

    Can anyone help?

    I try to put all my function in a separate .ASP file
    under scriptlib folder but when I call any function
    from the such asp file do not work meanwhile
    if I put the code inside the working asp works fine

    explain:
    mytools.asp
    <%SCRIPT Language="vbscript"%>
    function abc(pParam)
    abc = "OK"
    end function
    function xyz(pParam)
    xyz = "NOT OK"
    end function


    Main ASP File
    default.asp (Contains)

    <%
    <script language="vbscript" scr=scriptlib/mytools.asp">
    <font face="Verdana" size=1><%=abc("GO")%>
    </font>
    </script>
    %>


    TIA
    Jo
    Jose, Feb 23, 2004
    #1
    1. Advertising

  2. Jose

    middletree Guest

    Don't call in an external asp file with the <Script> tag. That's for
    client-side code.

    Do it in an include file instead


    "Jose" <> wrote in message
    news:%232qdcul%...
    > Can anyone help?
    >
    > I try to put all my function in a separate .ASP file
    > under scriptlib folder but when I call any function
    > from the such asp file do not work meanwhile
    > if I put the code inside the working asp works fine
    >
    > explain:
    > mytools.asp
    > <%SCRIPT Language="vbscript"%>
    > function abc(pParam)
    > abc = "OK"
    > end function
    > function xyz(pParam)
    > xyz = "NOT OK"
    > end function
    >
    >
    > Main ASP File
    > default.asp (Contains)
    >
    > <%
    > <script language="vbscript" scr=scriptlib/mytools.asp">
    > <font face="Verdana" size=1><%=abc("GO")%>
    > </font>
    > </script>
    > %>
    >
    >
    > TIA
    > Jo
    >
    >
    middletree, Feb 23, 2004
    #2
    1. Advertising

  3. Jose

    Roland Hall Guest

    "Jose" wrote:
    : Can anyone help?
    :
    : I try to put all my function in a separate .ASP file
    : under scriptlib folder but when I call any function
    : from the such asp file do not work meanwhile
    : if I put the code inside the working asp works fine
    :
    : explain:
    : mytools.asp
    : <%SCRIPT Language="vbscript"%>
    : function abc(pParam)
    : abc = "OK"
    : end function
    : function xyz(pParam)
    : xyz = "NOT OK"
    : end function
    :
    :
    : Main ASP File
    : default.asp (Contains)
    :
    : <%
    : <script language="vbscript" scr=scriptlib/mytools.asp">
    : <font face="Verdana" size=1><%=abc("GO")%>
    : </font>
    : </script>
    : %>

    Jo...

    This is client-side vbscript. You cannot nest the <script> tag. If you
    want to call the script via a script tag, then you need to remove that from
    the source document. Take out <script language="vbscript"></script> from
    mytools.asp.

    Another problem you have is syntax.
    <% %> or <script runat=server></script>, but not both.

    <%<script... is invalid.

    Change mytools.asp to:

    mytools.asp
    <%
    function abc(pParam)
    abc = "OK"
    end function
    function xyz(pParam)
    xyz = "NOT OK"
    end function
    %>

    Change default.asp to:

    <%@ Language=VBScript %>
    <%
    Option Explicit
    Response.Buffer = True
    %>
    <!--#include file="scriptlib/mytools.asp"-->
    <html>
    <head>
    </head>
    <body>
    <font face="Verdana" size=1><%=abc("GO")%></font>
    </body>
    </html>

    Or use .css
    <%@ Language=VBScript %>
    <%
    Option Explicit
    Response.Buffer = True
    %>
    <!--#include file="scriptlib/mytools.asp"-->
    <html>
    <head>
    <style type="text/css">
    ..v1 { font: normal xx-small verdana }
    </style>
    </head>
    <body>
    <span class="v1"><%=abc("GO")%></span>
    </body>
    </html>

    HTH...

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, Feb 24, 2004
    #3
  4. Jose

    Roland Hall Guest

    "Roland Hall" wrote:
    : "Jose" wrote:
    : : Can anyone help?
    : :
    : : I try to put all my function in a separate .ASP file
    : : under scriptlib folder but when I call any function
    : : from the such asp file do not work meanwhile
    : : if I put the code inside the working asp works fine
    : :
    : : explain:
    : : mytools.asp
    : : <%SCRIPT Language="vbscript"%>
    : : function abc(pParam)
    : : abc = "OK"
    : : end function
    : : function xyz(pParam)
    : : xyz = "NOT OK"
    : : end function
    : :
    : :
    : : Main ASP File
    : : default.asp (Contains)
    : :
    : : <%
    : : <script language="vbscript" scr=scriptlib/mytools.asp">
    : : <font face="Verdana" size=1><%=abc("GO")%>
    : : </font>
    : : </script>
    : : %>
    :
    : Jo...
    :
    : This is client-side vbscript. You cannot nest the <script> tag. If you
    : want to call the script via a script tag, then you need to remove that
    from
    : the source document. Take out <script language="vbscript"></script> from
    : mytools.asp.
    :
    : Another problem you have is syntax.
    : <% %> or <script runat=server></script>, but not both.
    :
    : <%<script... is invalid.
    :
    : Change mytools.asp to:
    :
    : mytools.asp
    : <%
    : function abc(pParam)
    : abc = "OK"
    : end function
    : function xyz(pParam)
    : xyz = "NOT OK"
    : end function
    : %>
    :
    : Change default.asp to:
    :
    : <%@ Language=VBScript %>
    : <%
    : Option Explicit
    : Response.Buffer = True
    : %>
    : <!--#include file="scriptlib/mytools.asp"-->
    : <html>
    : <head>
    : </head>
    : <body>
    : <font face="Verdana" size=1><%=abc("GO")%></font>
    : </body>
    : </html>
    :
    : Or use .css
    : <%@ Language=VBScript %>
    : <%
    : Option Explicit
    : Response.Buffer = True
    : %>
    : <!--#include file="scriptlib/mytools.asp"-->
    : <html>
    : <head>
    : <style type="text/css">
    : .v1 { font: normal xx-small verdana }
    : </style>
    : </head>
    : <body>
    : <span class="v1"><%=abc("GO")%></span>
    : </body>
    : </html>

    A little more info:

    <script language="vbscript">

    This is client-size and language on client-side has been deprecated. Use
    this instead:
    <script type="text/vbscript">

    On the server-side, you use this:
    <script language="vbscript" runat="server">

    ONLY ASP code goes in between here:

    <% %>

    ....unless you wrap the code in a Response.Write("")

    <%
    Response.Write("<html>" & vbCrLf)
    %>

    HTH...

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, Feb 24, 2004
    #4
  5. Jose

    Josaz Guest

    Thanks Much roland,
    Maybe you can answer me this question
    I wrote a .DLL in VB6 with the company business rule that I like to use
    along with my asp project how do I register it in the server in order for me
    to see it as a COM+ I understand that some changes need to be done in the
    ..DLL Code.

    TIA
    Jo

    "Roland Hall" <nobody@nowhere> wrote in message
    news:OFNKzum%...
    > "Roland Hall" wrote:
    > : "Jose" wrote:
    > : : Can anyone help?
    > : :
    > : : I try to put all my function in a separate .ASP file
    > : : under scriptlib folder but when I call any function
    > : : from the such asp file do not work meanwhile
    > : : if I put the code inside the working asp works fine
    > : :
    > : : explain:
    > : : mytools.asp
    > : : <%SCRIPT Language="vbscript"%>
    > : : function abc(pParam)
    > : : abc = "OK"
    > : : end function
    > : : function xyz(pParam)
    > : : xyz = "NOT OK"
    > : : end function
    > : :
    > : :
    > : : Main ASP File
    > : : default.asp (Contains)
    > : :
    > : : <%
    > : : <script language="vbscript" scr=scriptlib/mytools.asp">
    > : : <font face="Verdana" size=1><%=abc("GO")%>
    > : : </font>
    > : : </script>
    > : : %>
    > :
    > : Jo...
    > :
    > : This is client-side vbscript. You cannot nest the <script> tag. If you
    > : want to call the script via a script tag, then you need to remove that
    > from
    > : the source document. Take out <script language="vbscript"></script>

    from
    > : mytools.asp.
    > :
    > : Another problem you have is syntax.
    > : <% %> or <script runat=server></script>, but not both.
    > :
    > : <%<script... is invalid.
    > :
    > : Change mytools.asp to:
    > :
    > : mytools.asp
    > : <%
    > : function abc(pParam)
    > : abc = "OK"
    > : end function
    > : function xyz(pParam)
    > : xyz = "NOT OK"
    > : end function
    > : %>
    > :
    > : Change default.asp to:
    > :
    > : <%@ Language=VBScript %>
    > : <%
    > : Option Explicit
    > : Response.Buffer = True
    > : %>
    > : <!--#include file="scriptlib/mytools.asp"-->
    > : <html>
    > : <head>
    > : </head>
    > : <body>
    > : <font face="Verdana" size=1><%=abc("GO")%></font>
    > : </body>
    > : </html>
    > :
    > : Or use .css
    > : <%@ Language=VBScript %>
    > : <%
    > : Option Explicit
    > : Response.Buffer = True
    > : %>
    > : <!--#include file="scriptlib/mytools.asp"-->
    > : <html>
    > : <head>
    > : <style type="text/css">
    > : .v1 { font: normal xx-small verdana }
    > : </style>
    > : </head>
    > : <body>
    > : <span class="v1"><%=abc("GO")%></span>
    > : </body>
    > : </html>
    >
    > A little more info:
    >
    > <script language="vbscript">
    >
    > This is client-size and language on client-side has been deprecated. Use
    > this instead:
    > <script type="text/vbscript">
    >
    > On the server-side, you use this:
    > <script language="vbscript" runat="server">
    >
    > ONLY ASP code goes in between here:
    >
    > <% %>
    >
    > ...unless you wrap the code in a Response.Write("")
    >
    > <%
    > Response.Write("<html>" & vbCrLf)
    > %>
    >
    > HTH...
    >
    > --
    > Roland Hall
    > /* This information is distributed in the hope that it will be useful, but
    > without any warranty; without even the implied warranty of merchantability
    > or fitness for a particular purpose. */
    > Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    > WSH 5.6 Documentation -

    http://msdn.microsoft.com/downloads/list/webdev.asp
    > MSDN Library - http://msdn.microsoft.com/library/default.asp
    >
    >
    Josaz, Feb 26, 2004
    #5
  6. Jose

    Roland Hall Guest

    "Josaz" wrote:
    : Thanks Much roland,
    : Maybe you can answer me this question
    : I wrote a .DLL in VB6 with the company business rule that I like to use
    : along with my asp project how do I register it in the server in order for
    me
    : to see it as a COM+ I understand that some changes need to be done in the
    : .DLL Code.

    Jo...

    You register a .dll with regsvr32.
    http://www.vb2themax.com/HtmlDoc.asp?Table=Articles&ID=290&Page=3

    HTH...

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, Feb 27, 2004
    #6
  7. Jose

    Roland Hall Guest

    "Roland Hall" wrote:
    : "Josaz" wrote:
    : : Thanks Much roland,
    : : Maybe you can answer me this question
    : : I wrote a .DLL in VB6 with the company business rule that I like to use
    : : along with my asp project how do I register it in the server in order
    for
    : me
    : : to see it as a COM+ I understand that some changes need to be done in
    the
    : : .DLL Code.
    :
    : Jo...
    :
    : You register a .dll with regsvr32.
    : http://www.vb2themax.com/HtmlDoc.asp?Table=Articles&ID=290&Page=3

    An article that may be of benefit:
    http://www.15seconds.com/issue/010212.htm

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, Feb 27, 2004
    #7
  8. Jose

    Josaz Guest

    Thank you again roland, so forth I have done so
    Register the .DLL in the Server where IIS is hosting
    but when I try to call a function from it I get the ASP error

    '- This some part of my asp code.
    '- Trying to make it call to my .DLL (COM)
    <%@Language="vbscript" RUNAT="Server"%>
    <%
    Set myFunc = CreateObject("MyDll.CLass")
    %>
    <%=myFunc.This(this)%>
    or
    <%
    Response.write("myFunc.That(this)")
    %>
    Error page can not be displayed.

    Thanks again

    "Roland Hall" <nobody@nowhere> wrote in message
    news:%23Le9iyM$...
    > "Roland Hall" wrote:
    > : "Josaz" wrote:
    > : : Thanks Much roland,
    > : : Maybe you can answer me this question
    > : : I wrote a .DLL in VB6 with the company business rule that I like to

    use
    > : : along with my asp project how do I register it in the server in order
    > for
    > : me
    > : : to see it as a COM+ I understand that some changes need to be done in
    > the
    > : : .DLL Code.
    > :
    > : Jo...
    > :
    > : You register a .dll with regsvr32.
    > : http://www.vb2themax.com/HtmlDoc.asp?Table=Articles&ID=290&Page=3
    >
    > An article that may be of benefit:
    > http://www.15seconds.com/issue/010212.htm
    >
    > --
    > Roland Hall
    > /* This information is distributed in the hope that it will be useful, but
    > without any warranty; without even the implied warranty of merchantability
    > or fitness for a particular purpose. */
    > Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    > WSH 5.6 Documentation -

    http://msdn.microsoft.com/downloads/list/webdev.asp
    > MSDN Library - http://msdn.microsoft.com/library/default.asp
    >
    >
    Josaz, Feb 27, 2004
    #8
  9. Jose

    Roland Hall Guest

    "Josaz" wrote:
    : Thank you again roland, so forth I have done so
    : Register the .DLL in the Server where IIS is hosting
    : but when I try to call a function from it I get the ASP error
    :
    : '- This some part of my asp code.
    : '- Trying to make it call to my .DLL (COM)
    : <%@Language="vbscript" RUNAT="Server"%>
    : <%
    : Set myFunc = CreateObject("MyDll.CLass")
    : %>
    : <%=myFunc.This(this)%>
    : or
    : <%
    : Response.write("myFunc.That(this)")
    : %>
    : Error page can not be displayed.
    :
    : Thanks again

    Aren't you having a problem with this line?
    <%@Language="vbscript" RUNAT="Server"%>

    Try:
    <%@ Language=VBScript %>

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, Feb 27, 2004
    #9
    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. =?Utf-8?B?dHJlbGxvdzQyMg==?=

    HELP! HELP! HELP! Opening Web Application Project Error

    =?Utf-8?B?dHJlbGxvdzQyMg==?=, Feb 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    742
    =?Utf-8?B?dHJlbGxvdzQyMg==?=
    Feb 20, 2004
  2. Harvey
    Replies:
    0
    Views:
    669
    Harvey
    Jul 16, 2004
  3. Harvey
    Replies:
    1
    Views:
    818
    Daniel
    Jul 16, 2004
  4. =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=

    HELP - HELP - HELP

    =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=, Mar 9, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    662
    Eliyahu Goldin
    Mar 9, 2006
  5. Buster

    Help, Help, Help

    Buster, Oct 4, 2003, in forum: Java
    Replies:
    3
    Views:
    461
    Saager
    Oct 30, 2003
Loading...

Share This Page