一個sql查詢器,自動畫表格填字段
更新時間:2008年11月20日 13:56:17 作者:
隨便寫了一個,當(dāng)然為了數(shù)據(jù)安全,要過濾掉一個sql關(guān)鍵詞和系統(tǒng)中的一些表了
一個什么都不懂的家伙非跟我要個sql查詢器
隨便寫了一個,當(dāng)然為了數(shù)據(jù)安全,要過濾掉一個sql關(guān)鍵詞和系統(tǒng)中的一些表了
哦,對了,里面的一些函數(shù)你可能不知道哪里來的,是我現(xiàn)在開發(fā)一些東西一直用的自己寫的一個小框架
把常用的功能封裝一下,寫程序主要是思路,看一下代碼思想就知道我的原理了
<%
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
%>
隨便寫了一個,當(dāng)然為了數(shù)據(jù)安全,要過濾掉一個sql關(guān)鍵詞和系統(tǒng)中的一些表了
哦,對了,里面的一些函數(shù)你可能不知道哪里來的,是我現(xiàn)在開發(fā)一些東西一直用的自己寫的一個小框架
把常用的功能封裝一下,寫程序主要是思路,看一下代碼思想就知道我的原理了
<%
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實現(xiàn)對ORACLE數(shù)據(jù)庫的操作
用ASP實現(xiàn)對ORACLE數(shù)據(jù)庫的操作...2007-03-03在ASP中連接MySQL數(shù)據(jù)庫,最好的通過ODBC方法
在ASP中連接MySQL數(shù)據(jù)庫,最好的通過ODBC方法...2006-11-11ASP中怎么實現(xiàn)SQL數(shù)據(jù)庫備份、恢復(fù)!
ASP中怎么實現(xiàn)SQL數(shù)據(jù)庫備份、恢復(fù)!...2007-03-03