<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<script language="JavaScript">
function testdb() {
var objdbConn=new ActiveXObject("ADODB.Connection");
var strdsn="Driver=SQLOLEDB;SERVER=jdbc:sqlserver://localhost:1433;UID=sa;PWD=123456;DATABASE=flowerstore";
objdbConn.Open(strdsn);
document.write("成功");
objdbConn.Close();
}
</script>
<body>
page.
<br>
<input type="button" value="1" onclick="testdb()">
</body>
</html>
为什么上述代码不能成功连接数据库?点击按钮之后没有任何反应,请问是哪里出错了吗?