By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,656 Members | 968 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,656 IT Pros & Developers. It's quick & easy.

access denied

P: n/a

Hi!

I'm new in JavaScript, and tried out some examples.

If found an XML example at MSDN MSXML 4.0 DOM which is:
http://msdn.microsoft.com/library/de...th_hn_2uck.asp

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.load("C:\\temp\\books.xml");
if (xmlDoc.parseError.errorCode <> 0) {
var myError = xmlDoc.parseError;
alert("You have error " + myErr.reason);
} else {
alert(xmlDoc.xml);
}

Where ich changed the '<>' to '!='

but runnung this in IE6.0 I got an error 'access denied' at the loa
statement. The file could be opened in IE6.0. Erverything run
clientside without IIS.

What the reason for that?
Thanks for help
-
sinn

Jul 23 '05 #1
Share this Question
Share on Google+
16 Replies


P: n/a
sinna wrote:
Hi!

I'm new in JavaScript, and tried out some examples.

If found an XML example at MSDN MSXML 4.0 DOM which is:
http://msdn.microsoft.com/library/de...th_hn_2uck.asp

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.load("C:\\temp\\books.xml");
if (xmlDoc.parseError.errorCode <> 0) {
var myError = xmlDoc.parseError;
alert("You have error " + myErr.reason);
} else {
alert(xmlDoc.xml);
}

Where ich changed the '<>' to '!='

but runnung this in IE6.0 I got an error 'access denied' at the load
statement. The file could be opened in IE6.0. Erverything runs
clientside without IIS.

What the reason for that?
Thanks for help!


This works on my Win98 IE6

function showURL(adr) {
try {
var objDOM = new ActiveXObject("Msxml2.DOMDocument");
objDOM.async = false;
alert('adr= '+adr);
if (objDOM.load(adr))
alert(objDOM.xml);
else
alert("Error: " + objDOM.parseError.reason);
}
catch(e) {
alert("Error: " + e);
}
}
Jul 23 '05 #2

P: n/a
sinna wrote:
I'm new in JavaScript, and tried out some examples.
If found an XML example at MSDN MSXML 4.0 DOM which is:
http://msdn.microsoft.com/library/de...th_hn_2uck.asp

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.load("C:\\temp\\books.xml");
if (xmlDoc.parseError.errorCode <> 0) {
var myError = xmlDoc.parseError;
alert("You have error " + myErr.reason);
} else {
alert(xmlDoc.xml);
}

Where ich changed the '<>' to '!='
but runnung this in IE6.0 I got an error 'access denied' at the load
statement. The file could be opened in IE6.0. Erverything runs
clientside without IIS.
What the reason for that?


Try using this XML Sniffer to see what versions your browser supports.
When I tried your code I got 'Automation Server Can't Create Ojbect'.

The sniffer shows this about my system, not sure how to interpret it but
I'm not surprised there's a problem when trying to create an v4.0
object. You might see if you have similar results. If so you may have
some upgrades to install.

MSXML Installed
MSXML2 Installed
MSXML2 v2.6 Automation server can't create object
MSXML2 v3.0 Installed
MSXML2 v4.0 Automation server can't create object
Mode Replace V3

http://www.bayes.co.uk/xml/index.xml...ml_sniffer.htm

Good Luck,
MIke

Jul 23 '05 #3

P: n/a
mscir wrote:

This version of your code worked fine for me after installing MSXML 4.0
Service Pack 2 on my machine, you can get it here:

http://www.microsoft.com/downloads/d...DisplayLang=en

MSXML 4.0 Service Pack 2 (SP2) is a complete replacement of MSXML 4.0
and MSXML 4.0 Service Pack 1 (SP1). MSXML 4.0 SP2 provides a number of
security and bug fixes. MSXML 4.0 SP2 does not replace MSXML 3.0...

msxml.msi 5166 KB

function loadxmldoc() {
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.load("C:\\WINDOWS\\SYSTEM\\wmpscheme.xml");
if (xmlDoc.parseError.errorCode != 0) {
var myError = xmlDoc.parseError;
alert('Error: '+myErr.reason);
}
else
alert(xmlDoc.xml);
}

Good Luck,
Mike

Jul 23 '05 #4

P: n/a

mscir wrote:
*sinna wrote:
I'm new in JavaScript, and tried out some examples.
If found an XML example at MSDN MSXML 4.0 DOM which is:


http://msdn.microsoft.com/library/de...th_hn_2uck.asp

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.load("C:\\temp\\books.xml");
if (xmlDoc.parseError.errorCode <> 0) {
var myError = xmlDoc.parseError;
alert("You have error " + myErr.reason);
} else {
alert(xmlDoc.xml);
}

Where ich changed the '<>' to '!='
but runnung this in IE6.0 I got an error 'access denied' at th

load
statement. The file could be opened in IE6.0. Erverything runs
clientside without IIS.
What the reason for that?


Try using this XML Sniffer to see what versions your browse
supports.
When I tried your code I got 'Automation Server Can't Creat
Ojbect'.

The sniffer shows this about my system, not sure how to interpret i
but
I'm not surprised there's a problem when trying to create an v4.0
object. You might see if you have similar results. If so you ma
have
some upgrades to install.

MSXML Installed
MSXML2 Installed
MSXML2 v2.6 Automation server can't create object
MSXML2 v3.0 Installed
MSXML2 v4.0 Automation server can't create object
Mode Replace V3

http://www.bayes.co.uk/xml/index.xml...ml_sniffer.htm

Good Luck,
MIke *

First thanx!

The sniffer reports:

MSXML Sniffer
MSXML Installed
MSXML2 Installed
MSXML2 v2.6 Installed
MSXML2 v3.0 Installed
MSXML2 v4.0 Installed
Mode Replace V3

Which should mean MSXML is installed propper.

Is there any security option that has to be changed, so that JS can
access local files?
Andrea
-
sinn

Jul 23 '05 #5

P: n/a
sinna wrote:
<snip>
MSXML Sniffer
MSXML Installed
MSXML2 Installed
MSXML2 v2.6 Installed
MSXML2 v3.0 Installed
MSXML2 v4.0 Installed
Mode Replace V3

Which should mean MSXML is installed propper.

Is there any security option that has to be changed, so that JS cann
access local files?


I don't know right now... I wonder if it's due to v4.0's tighter
security. To help diagnose it, did you try this to see if it would work?

function showURL(adr) {
try {
var objDOM = new ActiveXObject("Msxml2.DOMDocument");
objDOM.async = false;
alert('adr= '+adr);
if (objDOM.load(adr))
alert(objDOM.xml);
else
alert("Error: " + objDOM.parseError.reason);
}
catch(e) {
alert("Error: " + e);
}
}
Jul 23 '05 #6

P: n/a
sinna wrote:
<snip>
Is there any security option that has to be changed, so that JS cann
access local files?


Are the html page with the javascript function and the xml doc running
on the same machine? Check this out:

http://oldlook.experts-exchange.com:..._20684307.html
Jul 23 '05 #7

P: n/a

mscir wrote:
*sinna wrote:
Hi!

I'm new in JavaScript, and tried out some examples.

If found an XML example at MSDN MSXML 4.0 DOM which is:


http://msdn.microsoft.com/library/de...th_hn_2uck.asp

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.load("C:\\temp\\books.xml");
if (xmlDoc.parseError.errorCode <> 0) {
var myError = xmlDoc.parseError;
alert("You have error " + myErr.reason);
} else {
alert(xmlDoc.xml);
}

Where ich changed the '<>' to '!='

but runnung this in IE6.0 I got an error 'access denied' at th

load
statement. The file could be opened in IE6.0. Erverything runs
clientside without IIS.

What the reason for that?
Thanks for help!


This works on my Win98 IE6

function showURL(adr) {
try {
var objDOM = new ActiveXObject("Msxml2.DOMDocument");
objDOM.async = false;
alert('adr= '+adr);
if (objDOM.load(adr))
alert(objDOM.xml);
else
alert("Error: " + objDOM.parseError.reason);
}
catch(e) {
alert("Error: " + e);
}
} *


This leeds to the on "object Error", which is thrown by the loa
methode. Removing the try .. catch statment produces again the 'acces
denied' message.

Thanx

Andrea
-
sinn

Jul 23 '05 #8

P: n/a

mscir wrote:
*mscir wrote:

This version of your code worked fine for me after installing MSXM
4.0
Service Pack 2 on my machine, you can get it here:

http://tinyurl.com/aw2g

MSXML 4.0 Service Pack 2 (SP2) is a complete replacement of MSXM
4.0
and MSXML 4.0 Service Pack 1 (SP1). MSXML 4.0 SP2 provides a numbe
of
security and bug fixes. MSXML 4.0 SP2 does not replace MSXML 3.0...

msxml.msi 5166 KB

function loadxmldoc() {
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.load("C:\\WINDOWS\\SYSTEM\\wmpscheme.xml");
if (xmlDoc.parseError.errorCode != 0) {
var myError = xmlDoc.parseError;
alert('Error: '+myErr.reason);
}
else
alert(xmlDoc.xml);
}

Good Luck,
Mike *


Hi Mike,

I hoped that this would help.
I donwloaded the .msi file and installed it, but it seems that I ha
allready SP2 installed, cause the install offered jus
repair/uninstall.
But the repair dosn't help.

I tried this on another computer were MSXML40 is not installed. ther
it works. (changing 'Msxml2.DOMDocument.4.0' to 'Msxml2.DOMDocument')

I believe that maybe a option in the IE could be the solution.

thank you
Andrea
-
sinn

Jul 23 '05 #9

P: n/a

mscir wrote:
*sinna wrote:
<snip>
Is there any security option that has to be changed, so that J

cann
access local files?


Are the html page with the javascript function and the xml do
running
on the same machine? Check this out:

http://oldlook.experts-exchange.com:...Q_20684307.htm
*


Hi,

Yes they do! It's all local. There is no webserver involved. Both th
HTML and the XML are resided in the same local directory.

The link deals with the crossplattform problem which I should no
have.

thank you

Andrea
-
sinn

Jul 23 '05 #10

P: n/a

sinna wrote:
*Hi,

Yes they do! It's all local. There is no webserver involved. Both th
HTML and the XML are resided in the same local directory.

The link deals with the crossplattform problem which I should no
have.

thank you

Andreas *


Hi,

It works if the files are an a network drive, but if the are on a loca
drive I got a error "ACCESS DENIED"

Seems to be problem with the access rights.

Any ideas?

Andrea
-
sinn

Jul 23 '05 #11

P: n/a

sinna wrote:
*Hi Mike,

I hoped that this would help.
I donwloaded the .msi file and installed it, but it seems that I ha
allready SP2 installed, cause the install offered jus
repair/uninstall.
But the repair dosn't help.

I tried this on another computer were MSXML40 is not installed. ther
it works. (changing 'Msxml2.DOMDocument.4.0' t
'Msxml2.DOMDocument')

I believe that maybe a option in the IE could be the solution.

thank you
Andreas *

Hi,

It works if the files are an a network drive, but if the are on a loca
drive I got a error "ACCESS DENIED"

Seems to be problem with the access rights.

Any ideas?

Andrea
-
sinn

Jul 23 '05 #12

P: n/a
sinna wrote:
sinna wrote: <snip> It works if the files are an a network drive, but if the are on a local
drive I got a error "ACCESS DENIED". Seems to be problem with the access rights.
Any ideas?


Sounds like you were right about it being a security issue all along. i
don't have IIS, can't use it on my win98, used PWS when doing ASP pages,
don't know how to set IIS security features. You might consider posting
to these newsgroups:

microsoft.public.xml
microsoft.public.inetserver.iis.security

----------------------------------------------------------------------

If you download this page and copy the xml file you want to open to the
folder where you download it, can you load the xml page?

http://rdcpro.com/xmldev/tools/

----------------------------------------------------------------------

The above page mentions setting browser security to allow acceess across
domains, although it may not be an issue for you now:

"Accessing XML documents from domains other than this one might be
disabled in your browser. To change your cross-domain data security
setting to 'Prompt.' In IE 6, go to Tools=>Internet Options and click
the 'Security' tab. Select Internet, then click the 'Custom Settings'
button. "Scroll down to 'Miscellaneous' and under 'Access Data Sources
Across Domains,' select 'Prompt'. "Click 'OK,' and answer 'Yes' to the
warning dialog. Click 'Ok' to close the 'Internet Options' dialog.
Internet Explorer will now ask for permission any time it tries to
access data from other Domains. If you do not trust a site making this
request, you should click 'No' whenever you see the dialog."

-----------------------------------------------------------------------

I don't know if this applies either:

http://www.derkeiler.com/Newsgroups/...3-10/0024.html

HOWTO: Track "Permission Denied" Errors on DLL Files

http://support.microsoft.com/?id=286198

-----------------------------------------------------------------------

If these don't help, you might also consider posting here:

http://www.perfectxml.com/msxmlask.asp

Good Luck,
Mike

Jul 23 '05 #13

P: n/a

mscir wrote:
*sinna wrote:
sinna wrote:

<snip>
It works if the files are an a network drive, but if the are on

local
drive I got a error "ACCESS DENIED". Seems to be problem with th

access rights.
Any ideas?


Sounds like you were right about it being a security issue all along
i
don't have IIS, can't use it on my win98, used PWS when doing AS
pages,
don't know how to set IIS security features. You might conside
posting
to these newsgroups:

microsoft.public.xml
microsoft.public.inetserver.iis.security

----------------------------------------------------------------------

If you download this page and copy the xml file you want to open t
the
folder where you download it, can you load the xml page?

http://rdcpro.com/xmldev/tools/

----------------------------------------------------------------------

The above page mentions setting browser security to allow accees
across
domains, although it may not be an issue for you now:

"Accessing XML documents from domains other than this one might be
disabled in your browser. To change your cross-domain data security
setting to 'Prompt.' In IE 6, go to Tools=>Internet Options an
click
the 'Security' tab. Select Internet, then click the 'Custo
Settings'
button. "Scroll down to 'Miscellaneous' and under 'Access Dat
Sources
Across Domains,' select 'Prompt'. "Click 'OK,' and answer 'Yes' t
the
warning dialog. Click 'Ok' to close the 'Internet Options' dialog.
Internet Explorer will now ask for permission any time it tries to
access data from other Domains. If you do not trust a site makin
this
request, you should click 'No' whenever you see the dialog."

-----------------------------------------------------------------------

I don't know if this applies either:

http://www.derkeiler.com/Newsgroups/...3-10/0024.html

HOWTO: Track "Permission Denied" Errors on DLL Files

http://support.microsoft.com/?id=286198

-----------------------------------------------------------------------

If these don't help, you might also consider posting here:

http://www.perfectxml.com/msxmlask.asp

Good Luck,
Mike *

Hi Mike,

thank you for helping me!

I don't use IIS either!
I found a solution, but I don't realy understand what is the bi
difference. I attached my solution.

cheers
Andrea

+----------------------------------------------------------------
| Attachment filename: xmlload.htm.txt
|Download attachment: http://www.forum4designers.com/attac...?postid=249697
+----------------------------------------------------------------

-
sinn

Jul 23 '05 #14

P: n/a
sinna wrote:
<snip>
I found a solution, but I don't realy understand what is the big
difference. I attached my solution.


Couldn't read it, also you're not supposed to use attachments with this
newsgroup. Would you mind posting the code here?

Jul 23 '05 #15

P: n/a

mscir wrote:
*sinna wrote:
<snip>
I found a solution, but I don't realy understand what is the big
difference. I attached my solution.


Couldn't read it, also you're not supposed to use attachments wit
this
newsgroup. Would you mind posting the code here? *


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>XML load</title>
</head>

<body vLink="#000066" aLink="#000066" link="#000066
bgColor="#ffffff" leftMargin="0" topMargin="0" marginheight="0
marginwidth="0">

<div id="xmlobj" xmlurl="" ><br/><br/>Loading...</div>

<script language="javascript">
var xmlfile;
xmlfile = "C:/Test.xml";
xmlobj.xmlurl = xmlfile;

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.preserveWhiteSpace = false;
xmlDoc.load( xmlobj.xmlurl );
if (xmlDoc.parseError.errorCode != 0)
alert("Error");
else
alert(xmlDoc.xml);
</script>

</body>
</html
-
sinn

Jul 23 '05 #16

P: n/a
Hi Mike or anyone else,

Just wanted to ask you how you installed MSXML 4.0 Core Services SP2 (I
have Visual Studio .NET Professional Installed on Windows XP)?

I donwloaded the relevant files:

msxml.msi 5166 KB
msxml4msms.exe 768 KB
MSXML4SP_RelNote.htm 23 KB
msxmlcab.exe 723 KB
msxmlsdk.exe 3392 KB

from->
http://www.microsoft.com/downloads/d...g=en&FamilyID=
3144b72b-b4f2-46da-b4b6-c5d7485f2b42

However, it didn't have any instructions as to how to install it. It
said if I was going to use the MSI file to install it, I had to download
the Windows Installer 2.0, but this is only required if you want to
package up MSXML 4.0 with your applicaiton right? So without downloading
the Windows Installer, I double-clicked on the msxml.msi file where I
had saved it. Then it installed. When I went to the directory where I
had installed it, there was nothing there. I don't understand. Please
help me, any feedback would be much appreciated.

Kind regards,

Noah.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.