Results 1 to 3 of 3

Thread: Calling a function

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Posts
    12
    I have an ASP Page with a function that goes like this :

    <%Public Sub Populate_Array()
    Dim con
    Dim rst
    Dim StrSql
    Set con = Server.CreateObject("ADODB.Connection")
    Set rst = Server.CreateObject("ADODB.RecordSet")
    con.Provider = "Microsoft.Jet.OLEDB.3.51"
    con.Open "C:\Inetpub\wwwroot\db\information.mdb"
    StrSql = "Select * From TeamNhl Order By TeamNhlName"
    rst.Open StrSql,con,adOpenStatic
    session("ArrayTeamNhl")=rst.GetRows
    rst.close
    con.Close
    End Sub%>

    How can i CALL that function from another page ??

  2. #2
    Guest
    Place this function in a include file and place the include line on you page where
    you want to use this function.

    Example: myfunction.inc

    And place this line on your page where you want to use the function.
    Code:
    <!-- #INCLUDE FILE="myfunction.inc"-->
    Now you can call the function in your page.

  3. #3
    Lively Member harsoni's Avatar
    Join Date
    Oct 2000
    Posts
    118

    Arrow

    Name the above file as say test.asp and then in the other asp include this pice of code.

    _____________________________________________

    Server.Execute "test.asp"
    _____________________________________________

    Sonia

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