一個(gè)sql查詢器,自動(dòng)畫表格填字段
更新時(shí)間:2008年11月20日 13:56:17 作者:
隨便寫了一個(gè),當(dāng)然為了數(shù)據(jù)安全,要過濾掉一個(gè)sql關(guān)鍵詞和系統(tǒng)中的一些表了
一個(gè)什么都不懂的家伙非跟我要個(gè)sql查詢器
隨便寫了一個(gè),當(dāng)然為了數(shù)據(jù)安全,要過濾掉一個(gè)sql關(guān)鍵詞和系統(tǒng)中的一些表了
哦,對(duì)了,里面的一些函數(shù)你可能不知道哪里來的,是我現(xiàn)在開發(fā)一些東西一直用的自己寫的一個(gè)小框架
把常用的功能封裝一下,寫程序主要是思路,看一下代碼思想就知道我的原理了
<%
function QuerySql(sql)
%>
<table width="680" cellspacing="1" cellpadding="3" border="0" bgcolor="#c7c7c7" align="center">
<%
set rs=getRs(sql)
FieldsNum=rs.Fields.Count
puts "<tr >"
for i=0 to FieldsNum-1
puts "<td style=""background:#ccc"">"&rs.Fields.item(i).name"</td>"
next
puts "</tr>"
do while not rs.eof
puts "<tr>"
for i=0 to FieldsNum-1
puts "<td>"&rs(i)"</td>"
next
puts "</tr>"
rs.movenext
loop
%>
</table>
<%
end function
%>
隨便寫了一個(gè),當(dāng)然為了數(shù)據(jù)安全,要過濾掉一個(gè)sql關(guān)鍵詞和系統(tǒng)中的一些表了
哦,對(duì)了,里面的一些函數(shù)你可能不知道哪里來的,是我現(xiàn)在開發(fā)一些東西一直用的自己寫的一個(gè)小框架
把常用的功能封裝一下,寫程序主要是思路,看一下代碼思想就知道我的原理了
<%
function QuerySql(sql)
%>
<table width="680" cellspacing="1" cellpadding="3" border="0" bgcolor="#c7c7c7" align="center">
<%
set rs=getRs(sql)
FieldsNum=rs.Fields.Count
puts "<tr >"
for i=0 to FieldsNum-1
puts "<td style=""background:#ccc"">"&rs.Fields.item(i).name"</td>"
next
puts "</tr>"
do while not rs.eof
puts "<tr>"
for i=0 to FieldsNum-1
puts "<td>"&rs(i)"</td>"
next
puts "</tr>"
rs.movenext
loop
%>
</table>
<%
end function
%>
相關(guān)文章
ASP 日期的加減運(yùn)算實(shí)現(xiàn)代碼
今天在工作中遇到了一個(gè)問題,需要按時(shí)間查詢,可是查詢出來的結(jié)果顯示的不正確。2009-12-12用ASP實(shí)現(xiàn)對(duì)ORACLE數(shù)據(jù)庫的操作
用ASP實(shí)現(xiàn)對(duì)ORACLE數(shù)據(jù)庫的操作...2007-03-03ASP讀取XML實(shí)例 優(yōu)酷專輯采集程序 雷鋒版
用asp獲取指定專題的xml文件,然后讀取xml文件的列表內(nèi)容批量讀取。2009-12-12在ASP中連接MySQL數(shù)據(jù)庫,最好的通過ODBC方法
在ASP中連接MySQL數(shù)據(jù)庫,最好的通過ODBC方法...2006-11-11ASP中怎么實(shí)現(xiàn)SQL數(shù)據(jù)庫備份、恢復(fù)!
ASP中怎么實(shí)現(xiàn)SQL數(shù)據(jù)庫備份、恢復(fù)!...2007-03-03