else
echo "<script>alert('已经没有了!');history.back();</script>"
Response.End()
end if
echo "<br>"
echo iif(action="add","","<input type=submit value=保存 onclick=this.form.action.value='save';> ")
echo "<input type=button value=添加 onclick=if(confirm('确实要添加当前为新记录吗?')){this.form.action.value='new';this.form.submit();};> "
echo "<input type=button value=上一条 onclick=""this.form.action.value='pre';this.form.submit();""> "
echo "<input type=button value=下一条 onclick=""this.form.action.value='next';this.form.submit();""> "
echo "<a href='?key=view&table_name=" & names & "'>表结构</a> "
echo "<a href='?key=sql&sql=select * from " & names & "&table_name="& names & "&primarykey="&keys&"'>表浏览</a> "
echo "<a href='?'>主界面</a> "
echo "</form></td></tr></table>"
end sub
'==================================================================显示存储过程
sub showproc()
dim sTableName,adox
on error resume next
echo "存储过程:<font color=red>" & Request("table_name") & "<font><br>"
sTableName = Request("table_name")
Set adox = Server.CreateObject("ADOX.Catalog")
adox.ActiveConnection = Conn
echo "<textarea cols=70 rows=8>" & adox.Procedures(sTableName).Command.CommandText & "</textarea><br>"
if err <> 0 then
echo err.description
exit sub
end if
end sub
'==================================================================分页导航
'分页导航
sub showNavBar (rs,page,pageUrl,pageSize)
page = cint(page)
%>
<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<% if request("primarykey") <> "" and request("table_name") <> "" then %>
<td align="left">当前表:<font color=red><%=request("table_name")%></font>
<a href="?key=edit&table_name=<%=request("table_name")%>&primarykey=<%=request("primarykey")%>&action=add">插入新记录</a>
</td>
<% end if %>
<td align="right">
<%
echo "共有" & rs.recordCount & "条纪录 当前" & page & "/" & rs.PageCount & "页"
if page > 1 then
echo "<a href='" & pageUrl & "&page=1&pageSize="&pageSize&"'>首页</a> "
echo "<a href='" & pageUrl & "&page=" & page - 1 & "&pageSize="&pageSize&"'>上页</a> "
end if
if (rs.PageCount > 1 and page < rs.PageCount) then
echo "<a href='" & pageUrl & "&page=" & page + 1 & "&pageSize="&pageSize&"'>下页</a> "
echo "<a href='" & pageUrl & "&page=" & rs.pageCount & "&pageSize="&pageSize&"'>末页</a> "
end if
echo "转到:第"
echo "<select name='select2' onChange='location.href=this.value;'>"
dim i
for i = 1 to rs.PageCount
echo "<option value='"& pageUrl &"&pageSize="&pageSize&"&page="& i & "' "
if i = cint(page) then echo "selected"
echo ">"& i &"</option>"
next
echo "</select>页"
%>
</td>
</tr>
</table>
<%
end sub









