本文介绍了HTA:“此计算机上的安全设置禁止访问另一个域上的数据源"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在像其他两个线程一样处理相同的错误消息(作为主题):在JavaScript/HTM页面中禁止ADO安全警告如何创建无需服务器即可动态访问数据库的Intranet网站或服务器端脚本?但是我的应用程序仅在本地计算机上运行,​​与任何网络或远程数据库无关.

I am dealing with the same error message (as the subject) like two other threads:Suppress ADO Security Warning in JavaScript/HTM Page and How to create intranet website accessing database dynamically without server or server side scripts?but my application runs on the local computer only, it has nothing to do with any network or remote database.

该问题仅发生在我的某些用户的计算机上.我将程序简化为1.js和1.hta,如下所示.通过命令行"cscript.exe 1.js"运行1.js在用户计算机(Windows 7)上运行正常.但是在同一台计算机上运行1.hta时出现错误此计算机上的安全设置禁止访问另一个域上的数据源". 1.js和1.hta几乎相同!

The problem happens on some of my users' computer only. I have simplified the program to 1.js and 1.hta as listed below. Run 1.js through command line "cscript.exe 1.js" works fine on the users' computer (Windows 7). But run 1.hta on the same computer got the error "Safety Settings on this computer prohibit accessing a data source on another domain". 1.js and 1.hta are nearly the same!

造成问题的行正在调用:ado.LoadFromFile("1.hta");我必须使用ADO而不是fso(Scripting.FileSystemObject),因为fso无法访问utf-8.

The line that makes the problem is calling : ado.LoadFromFile("1.hta");I have to use ADO instead of fso (Scripting.FileSystemObject), because fso can't access utf-8.

==== 1.js ===========

==== 1.js ===========

// run me through a DOS box command line : cscript.exe 1.js
var ado; 
ado = new ActiveXObject("ADODB.Stream");
var data;
ado.CharSet = "utf-8";
ado.Open();
ado.LoadFromFile("1.js");
data = ado.ReadText();
ado.Close();
WScript.echo(data);

==== 1.hta ==========

==== 1.hta ==========

<HTML>
<HEAD>
<meta http-equiv="x-ua-compatible" content="ie=9">
<HTA:APPLICATION ID="Debug" 
   caption="yes" 
   maximizebutton="no" 
   minimizebutton="no" 
   sysmenu="yes" 
   BORDERSTYLE="complex"
   BORDER="thick"
/>
<TITLE>HTA - Debug</TITLE>
<script language="JScript">
var ado; 
ado = new ActiveXObject("ADODB.Stream");
var data;
ado.CharSet = "utf-8";
ado.Open();
ado.LoadFromFile("1.hta");
data = ado.ReadText();
ado.Close();
</script>
</HEAD>
<BODY>
<H2>HTA - Debug, try to read my own source code "1.hta"</H2>
<div id=sourcecode></div>
<script language="JScript"> sourcecode.innerText=data;</script>
</BODY>
</HTML>

1.hta在我可以找到的所有Windows7,Windows 8,Windows 10计算机上都可以正常工作.为了确保可以为我提供帮助的人能够100%重现该问题,我发现1.hta在Windows XP上始终会失败.那是我重现问题的唯一方法.我们已尝试更改IE的安全设置,它既不能使计算机处于故障状态,也不能使任何健康的计算机陷入疾病.我相信HTA不会引用IE的设置.

1.hta works fine on all Windows7, windows 8, windows 10 computers I can find. To make sure someone who can help me would be able to 100% reproduce the problem, I have found that 1.hta always failed on Windows XP. That's the only way I can reproduce the problem. We have tried to change IE's security settings, it doesn't work for either fixed the computer in ill or push any healthy computer into illness. I believe HTA does not refer to IE's settings.

为什么在某些计算机上会发生这种情况?请给我任何提示,将不胜感激.

Why is this happening on some computers? Point me any hint would be very much appreciated.

推荐答案

这对我来说效果很好.

修改IE中的Internet选项:

Modify the internet options in IE:

转到Internet选项-安全选项卡-选择Internet和本地Intranet-单击自定义级别(按钮)-其他-选择跨域访问数据源的启用.

Go to Internet options -- Security Tab -- Select Internet and Local Intranet -- click Custom Level (button ) -- Miscellaneous -- select enable for Access data source across domains.

此后,我重新打开了QLIKVIEW模型.

After that I reopened theQLIKVIEW model.

对我来说确实有效.

祝你好运

这篇关于HTA:“此计算机上的安全设置禁止访问另一个域上的数据源"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 17:31