Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2003
    Location
    Canada
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to call function

    Hi, guys.

    I want to ask you how to call function.
    Please take a look at code.

    Code:
    <html>
    <HEAD>
    <SCRIPT LANGUAGE="VBSCRIPT">
    	Sub A1_OnClick 
    		call whatever()
    	End Sub
    </SCRIPT>
    </HEAD>
    <title>Create Excel on Server</title>
    <body bgcolor="#FFFFFF">
    <!--#Include file="functions.inc"-->
    <INPUT TYPE=BUTTON NAME="A1" VALUE="A1 Create">
    
    </body>
    </html>
    Clicking button will call the function in functions.inc file
    -functions.inc
    Code:
    <%
    Function whatever()
    'Name of the access db being queried
    accessdb="tech_re" 
    .......
    End function
    %>
    But when I clicked the button, it says error message.
    Type mismatch 'whatever'
    But I checked spelling, nothing is wrong as you can see.
    Can you guys see the problem? Thank you.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your include file is SERVER SIDE code and will only be available to functions run while the page is being processed by the server while your calling function is CLIENT SIDE which is only run AFTER the server has already finished processing the page.

    You must remember that SERVER SIDE code runs first and will always be 100% completely finished before any of the CLIENT SIDE code starts to execute. Calls from one to the other are not possible.
    Check out the Forum Search. It's the short path to getting great results from this forum.


  •  

    Posting Permissions

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