<!DOCTYPE HTML PUBLIC "-//W3C//DTDHTML4.0Transitional//EN">
<html>
<head>
<title></title>
<metaname="GENERATOR"content="MicrosoftVisualStudio.NET7.1">
<metaname="vs_targetSchema"content="http://schemas.microsoft.com/
intellisense/ie5">
<scriptid="clientEventHandlersJS"language="javascript">
<!--
functionButton1_onclick(){
varlocator=newActiveXObject("WbemScripting.SWbemLocator");
varservice=locator.ConnectServer(".","rootMicrosoftSQLServer");
varproperties=service.ExecQuery("SELECTNameFROMMSSQL_Database");
vare=newEnumerator(properties);
document.write("<tableborder=1>");
dispHeading();
for(;!e.atEnd();e.moveNext())
{
varp=e.item();
document.write("<tr>");
document.write("<td>"+p.Name+"</td>");
document.write("<td>"+p.SQLServerName+"</td>");
document.write("</tr>");
}
document.write("</table>");
}
functiondispHeading()
{
document.write("<thead>");
document.write("<td>Name</td>");
document.write("<td>SQLServerName</td>");
document.write("</thead>");
}
//-->
</script>
</head>
<body> <INPUTid="Button1"type="button"value="Button"name="Button1"
language="javascript"onclick="returnButton1_onclick()">
</body>
</html>
用JAVASCRIPT连接sql server数据库
最新推荐文章于 2025-05-26 11:07:14 发布