% dim current_page my_id=request("id") Set conn=Server.CreateObject("ADODB.Connection") conn.open "Driver=microsoft Access Driver (*.mdb);DBQ="&Server.MapPath("./db/hc_db.mdb") Set rs1=Server.CreateObject("ADODB.Recordset") Set rs2=Server.CreateObject("ADODB.Recordset") sql="select * from news where nid="& my_id &" order by date" rs1.open sql,conn,1 sql="select * from news_appendix where nid="&my_id rs2.open sql,conn,1 total_page = CLng(rs2.PageCount) current_page=CLng(request("page")) if current_page="" then current_page=1 elseif current_page>total_page then current_page=total_page elseif current_page<1 then current_page=1 end if %>
|
|||||||||||||||||||||||||||||||||||||