html下利用javascript連數(shù)據(jù)庫(kù)
更新時(shí)間:2008年02月22日 14:14:16 作者:
html下利用javascript操作本地?cái)?shù)據(jù)庫(kù)的代碼
復(fù)制代碼 代碼如下:
<script language="javascript">
//用 JavaScript 寫(xiě)服務(wù)器端連接數(shù)據(jù)庫(kù)的代碼示例
var conn = new ActiveXObject("ADODB.Connection");
conn.Open("DBQ=c:\\a.mdb;DRIVER={Microsoft Access Driver (*.mdb)};");
var rs = new ActiveXObject("ADODB.Recordset");
var sql="select * from friends_infor";
rs.open(sql, conn);
shtml = "<table width='100%' border=1>";
shtml +="<tr bgcolor='#f4f4f4'><td>au_id</td><td>au_lname</td><td>au_fname</td></tr>";
while(!rs.EOF)
{
shtml += "<tr><td>" + rs("friend_id") + "</td><td>" + rs("friend_name") + "</td><td>" + rs("friend_nickname") + "</td></tr>";
rs.moveNext;
}
shtml += "</table>";
document.write(shtml);
rs.close();
rs = null;
conn.close();
conn = null;
</script>
相關(guān)文章
客齊集OEM的CSS解析與開(kāi)發(fā)經(jīng)驗(yàn)
客齊集OEM的CSS解析與開(kāi)發(fā)經(jīng)驗(yàn)...2007-03-03
采用XHTML和CSS設(shè)計(jì)可重用可換膚的WEB站點(diǎn)的方法
隨著XHTML的逐漸推廣流行,HTML 在許多場(chǎng)合已經(jīng)顯得過(guò)時(shí)。World Wide Web Consortium (W3C) 于 2000 年 6 月 26 日發(fā)布了 XHTML 的第一個(gè)版本作為推薦標(biāo)準(zhǔn)。2008-09-09
ul+li及css制作韓國(guó)風(fēng)格菜單代碼
ul+li及css制作韓國(guó)風(fēng)格菜單代碼...2007-11-11
DIV+CSS布局中不推薦使用的標(biāo)簽集合Dont Use These Tags
DIV+CSS布局中不推薦使用的標(biāo)簽集合Dont Use These Tags...2007-12-12

