Forum Moderators: open
Function executeRead(sql)
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open dbStr
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = 3
rs.Open sql, oConn, 3, 4
Set rs.ActiveConnection = Nothing
executeRead = rs
oConn.Close
Set oConn = Nothing
Set rs = Nothing
End Function
and in my nav.asp i try and call that function:
rs = executeRead("SELECT * FROM ioms_nav")
While (NOT rs.EOF)
response.write rs("n_name")
rs.MoveNext()
Wend
rs.close
i was hoping to create a connection using executeRead and return the result to use it in nav.asp but it doesn't seem to like it.
Also my index.asp can read in an asp file and store it into a variable called "output". However when i do Response.Write(output) it just writes the page out as html format. Is there a way i can just read the asp file and use the code within that file?
Please help me.
Thank You
openDatabase( objConn )
set rs = objConn.Execute("SELECT * FROM ioms_nav")
' do stuff
closeDatabase( objConn )
Or use a disconnected recordsets instead.
Google for "Display Recordset Data in a Paged Fashion" for a good aexample of this.
For the the second question, you can use server.Execute or Response.Redirect to execute code in another page.