Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hta也提示:此计算机上的安全设置禁止访问其它域的数据源

13 views
Skip to first unread message

Rimifon

unread,
Sep 18, 2009, 11:36:21 PM9/18/09
to
将如下代码另存为hta,运行时提示:“此计算机上的安全设置禁止访问其它域的数据源”
 
<script type="text/javascript">
alert(new ActiveXObject("Adodb.Recordset").activeCommand);
</script>
 
wsh环境下运行是不会有安全错误提示的。hta也应该没有安全限制才对(我已经在IE中的所有区域都设置了允许垮域访问数据源,仍然无效),难道是微软的bug?
 
另外,通过Command创建的rs对象,访问activeCommand对象很正常:
<script type="text/javascript">
var cmd = new ActiveXObject("Adodb.Command");
cmd.activeConnection = "Provider=Microsoft.Jet.OleDb.4.0;dbase 5.0;DataBase=.";
cmd.commandText = "select now()";
var rs = cmd.execute();
alert(rs.activeCommand.commandText);
rs.activeConnection.close();
</script>
0 new messages