PDA

Click to See Complete Forum and Search --> : Calling a function


buster1000
Mar 21st, 2001, 10:07 PM
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 ??

Mar 22nd, 2001, 03:26 AM
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.

<!-- #INCLUDE FILE="myfunction.inc"-->

Now you can call the function in your page.

harsoni
Mar 22nd, 2001, 08:59 AM
Name the above file as say test.asp and then in the other asp include this pice of code.

_____________________________________________

Server.Execute "test.asp"
_____________________________________________

Sonia