在线数据库管理工具(db007) v1.5(29)
if page="" or not isNumeric(page) then page=1
pageUrl = "?key=sql&sql=" & sql
if request("primarykey") <> "" and request("table_name") <> "" then
pageUrl = pageUrl & "&table_name=" & request("table_name") & "&primarykey=" & request("primarykey")
end if
'--------------------------
dim rs
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql,conn,3
if not rs.eof then
rs.pageSize = pageSize
if cint(page) < 1 then page = 1
if cint(page) > rs.PageCount then page = rs.PageCount
rs.absolutePage = page
end if
'显示分页导航
showNavBar rs,page,pageUrl,pageSize
'-------------------------------
echo "<div style='overflow-x:auto;overflow-y:auto; width:800;height:380;'>"
echo "<table border=0 border=0 cellpadding=3 cellspacing=1 bgcolor=#CCCCCC><tr>"
primarykey = request("primarykey")
if primarykey <> "" and request("table_name") <> "" then
echo "<td bgcolor=#ffffff>操作</td><td bgcolor=#ffffff>删</td>"
end if
for i = 0 to rs.fields.count - 1 '循环字段名
set field = rs.fields.item(i)
echo "<td bgcolor=#ffffff>" & field.name & " </td>"
next
echo "</tr>"
dim i,field,j
do while not rs.eof and j < rs.pageSize '循环数据
echo "<tr>"
if primarykey <> "" and request("table_name") <> "" then
echo "<td bgcolor=#ffffff nowrap><a href='?key=edit&table_name=" & request("table_name") & "&primarykey=" & primarykey & "&primarykeyvalue=" & rs(primarykey) & "'><font color=#666666>编辑</font></a></td>"
内容版权声明:除非注明,否则皆为本站原创文章。