<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<style type="text/css">
table { background-color:#000000; cursor:hand; width:100%; }
td {
onmouseover: expression(οnmοuseοver=function (){this.style.borderColor ='blue';this.style.color='red';this.style.backgroundColor ='yellow'});
onmouseout: expression(οnmοuseοut=function (){this.style.borderColor='';this.style.color='';this.style.backgroundColor =''});
background-color:#ffffff;
}
</style>
<body>
<div style="width:100%; ">
<input type='button' value='新增' style='width:50px;height:25px;'/>
</div>
<table id="table_1" border='1'>
<tr>
<td align="center" >用户名</td><td align="center" >组织</td><td align="center" >操作</td>
</tr>
</table>
</body>
<script language=JavaScript>
var tableobj=document.getElementById("table_1");
var sql = "select c_oid_user,c_name,c_orgunitname from tb_sys_user where rownum<=10";
//新建数据库连接对象和数据集存取对象
var ConnDB = new ActiveXObject("ADODB.Connection");
ConnDB.open("Provider=MSDAORA.1;Password=修改;User ID=修改;Data Source=修改;Persist Security Info=false");
var rs = new ActiveXObject("ADODB.Recordset");
rs.ActiveConnection = ConnDB;
rs.Open(sql);
//遍历
var s;
while(!rs.EOF){
debugger;
for(i = 0;i<rs.Fields.Count;++i){
var userId=rs.Fields(0).value;//用来本地打开文件
var userName=rs.Fields(1).value;//获取文档类别,用作更新参数
var userOrgname=rs.Fields(2).value;//
var rowobj=tableobj.insertRow(tableobj.rows.length);
var cell1=rowobj.insertCell(rowobj.cells.length);
var cell2=rowobj.insertCell(rowobj.cells.length);
var cell3=rowobj.insertCell(rowobj.cells.length);
cell1.innerHTML=userName;
cell2.innerHTML=userOrgname;
cell3.innerHTML="<a οnclick='del("+userId+")'>删除</a>";
}
rs.MoveNext();//指针下移
}
var sql=null;
rs.close;
ConnDB.close;
function del(oid){
alert(oid);
}
</script>
</html>