Active Server Pages Programming (ASP)/Calling a function within an ASP Page
Expert: Srini Nagarajan - 12/14/2004
QuestionHi...
I am calling a function or sub if u may call it from within the same page.
it works fine until i execute a ado command object.
as soon as i put the execute statement in the page, all activites stop and the page doesnt execute any further from the line calling that function.
can u help me plz?
I use SQL server 2000 thru adodb from ASP page
AnswerHi
Sorry for the delay... here is the simple example how to use this
fsSQL = "SELECT * FROM Table "
Set fsTmp = SQLGetRS(fsSQL)
Function SQLGetRS(ByVal SQL)
Dim rs
Dim conn
Err.number = 0
Set conn = CreateObject("ADODB.Connection")
'open connection and execute query
conn.Open Application("ConnectionString")
Set rs = conn.Execute(SQL, , 1)
Set rs.ActiveConnection = Nothing
Set conn = Nothing
'return the results
Set SQLGetRS = rs
Set rs = Nothing
End Function
Try like this...
-srini