%
table=Request("table")
no=Request("no")
page=Request("page")
startpage=Request("startpage")
Set DbCon=Server.CreateObject("ADOdb.Connection")
DbCon.Open ("DSN=hanwed;UID=sa;PWD=")
Set DbRec=Server.CreateObject("ADODB.Recordset")
DbRec.Open "select * from "&table&" order by ref desc,step asc", DbCon,1,1
do while not dbrec.eof
if path="2" then
nextno=dbrec("no")
exit do
end if
if int(dbrec("no"))=int(no) then
path="2"
end if
dbrec.movenext
loop
dbcon.close
set dbrec=nothing
set dbcon=nothing
Set DbCon=Server.CreateObject("ADOdb.Connection")
DbCon.Open ("DSN=hanwed;UID=sa;PWD=")
Set DbRec2=Server.CreateObject("ADODB.Recordset")
DbRec2.Open "select * from "&table&" order by ref asc,step desc", DbCon,1,1
do while not dbrec2.eof
if path="1" then
prevno=dbrec2("no")
exit do
end if
if int(dbrec2("no"))=int(no) then
path="1"
end if
dbrec2.movenext
loop
sql = "select * from "&table&" where no ="&no
Set RS = dbcon.Execute(sql)
%>
|
|
<%
rnum=rs("visited") + 1
sql1="update "&table&" Set Visited=" & rnum & " where No=" & no
dbcon.Execute(sql1)
dbcon.close
set dbrec=nothing
set dbcon=nothing
set rs=nothing
%>