
======================
Global.asa
======================
Sub Session_OnStart
Set Session("Conn") = Server.CreateObject("ADODB.Connection")
Session("Conn").Provider = "SQLOLEDB"
Session("Conn").Open("server=192.168.0.22;UID=sa;P WD=test;database=test;")
end sub
======================
index.asp
======================
sql = "SELECT IDX, CLIENTIDX, COMPANY FROM CL_ADDRESSES WHERE CLIENTIDX= '" & Session.Contents("clientidx") & "' ORDER BY COMPANY"
rs.CursorLocation = 3
rs.CursorType = 3
rs.ActiveConnection = Session("Conn")
set rs = Session("Conn").Execute(Sql)
rs.PageSize = 20
rs.CacheSize = rs.PageSize
intPageCount = rs.PageCount
intRecordCount = rs.RecordCount
================================================== ===================
Instead of using Execute, how do i use "Open" to run the statement? I need to retrieve the value from the "Select" statement.
The way i'm doing now will return me -1 for rs.pagecount and rs.recordcount
Thanks in advance