access denied

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sinna

    #1

    access denied


    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.DOMDocum ent.4.0");
    xmlDoc.async = false;
    xmlDoc.resolveE xternals = false;
    xmlDoc.load("C: \\temp\\books.x ml");
    if (xmlDoc.parseEr ror.errorCode <> 0) {
    var myError = xmlDoc.parseErr or;
    alert("You have error " + myErr.reason);
    } else {
    alert(xmlDoc.xm l);
    }

    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

  • mscir

    #2
    Re: access denied

    sinna wrote:
    [color=blue]
    > 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.DOMDocum ent.4.0");
    > xmlDoc.async = false;
    > xmlDoc.resolveE xternals = false;
    > xmlDoc.load("C: \\temp\\books.x ml");
    > if (xmlDoc.parseEr ror.errorCode <> 0) {
    > var myError = xmlDoc.parseErr or;
    > alert("You have error " + myErr.reason);
    > } else {
    > alert(xmlDoc.xm l);
    > }
    >
    > 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![/color]

    This works on my Win98 IE6

    function showURL(adr) {
    try {
    var objDOM = new ActiveXObject(" Msxml2.DOMDocum ent");
    objDOM.async = false;
    alert('adr= '+adr);
    if (objDOM.load(ad r))
    alert(objDOM.xm l);
    else
    alert("Error: " + objDOM.parseErr or.reason);
    }
    catch(e) {
    alert("Error: " + e);
    }
    }


    Comment

    • mscir

      #3
      Re: access denied

      sinna wrote:
      [color=blue]
      > 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.DOMDocum ent.4.0");
      > xmlDoc.async = false;
      > xmlDoc.resolveE xternals = false;
      > xmlDoc.load("C: \\temp\\books.x ml");
      > if (xmlDoc.parseEr ror.errorCode <> 0) {
      > var myError = xmlDoc.parseErr or;
      > alert("You have error " + myErr.reason);
      > } else {
      > alert(xmlDoc.xm l);
      > }
      >
      > 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?[/color]

      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



      Good Luck,
      MIke

      Comment

      • mscir

        #4
        Re: access denied

        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.DOMDocum ent.4.0");
        xmlDoc.async = false;
        xmlDoc.resolveE xternals = false;
        xmlDoc.load("C: \\WINDOWS\\SYST EM\\wmpscheme.x ml");
        if (xmlDoc.parseEr ror.errorCode != 0) {
        var myError = xmlDoc.parseErr or;
        alert('Error: '+myErr.reason) ;
        }
        else
        alert(xmlDoc.xm l);
        }

        Good Luck,
        Mike

        Comment

        • sinna

          #5
          Re: access denied


          mscir wrote:[color=blue]
          > *sinna wrote:
          >[color=green]
          > > I'm new in JavaScript, and tried out some examples.
          > > If found an XML example at MSDN MSXML 4.0 DOM which is:[/color]
          >
          > http://msdn.microsoft.com/library/de...th_hn_2uck.asp[color=green]
          > >
          > > var xmlDoc = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
          > > xmlDoc.async = false;
          > > xmlDoc.resolveE xternals = false;
          > > xmlDoc.load("C: \\temp\\books.x ml");
          > > if (xmlDoc.parseEr ror.errorCode <> 0) {
          > > var myError = xmlDoc.parseErr or;
          > > alert("You have error " + myErr.reason);
          > > } else {
          > > alert(xmlDoc.xm l);
          > > }
          > >
          > > Where ich changed the '<>' to '!='
          > > but runnung this in IE6.0 I got an error 'access denied' at th[/color]
          > load[color=green]
          > > statement. The file could be opened in IE6.0. Erverything runs
          > > clientside without IIS.
          > > What the reason for that?[/color]
          >
          > 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 *[/color]


          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

          Comment

          • mscir

            #6
            Re: access denied

            sinna wrote:
            <snip>[color=blue]
            > 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?[/color]

            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.DOMDocum ent");
            objDOM.async = false;
            alert('adr= '+adr);
            if (objDOM.load(ad r))
            alert(objDOM.xm l);
            else
            alert("Error: " + objDOM.parseErr or.reason);
            }
            catch(e) {
            alert("Error: " + e);
            }
            }


            Comment

            • mscir

              #7
              Re: access denied

              sinna wrote:
              <snip>[color=blue]
              > Is there any security option that has to be changed, so that JS cann
              > access local files?[/color]

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




              Comment

              • sinna

                #8
                Re: access denied


                mscir wrote:[color=blue]
                > *sinna wrote:
                >[color=green]
                > > Hi!
                > >
                > > I'm new in JavaScript, and tried out some examples.
                > >
                > > If found an XML example at MSDN MSXML 4.0 DOM which is:[/color]
                >
                > http://msdn.microsoft.com/library/de...th_hn_2uck.asp[color=green]
                > >
                > > var xmlDoc = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
                > > xmlDoc.async = false;
                > > xmlDoc.resolveE xternals = false;
                > > xmlDoc.load("C: \\temp\\books.x ml");
                > > if (xmlDoc.parseEr ror.errorCode <> 0) {
                > > var myError = xmlDoc.parseErr or;
                > > alert("You have error " + myErr.reason);
                > > } else {
                > > alert(xmlDoc.xm l);
                > > }
                > >
                > > Where ich changed the '<>' to '!='
                > >
                > > but runnung this in IE6.0 I got an error 'access denied' at th[/color]
                > load[color=green]
                > > statement. The file could be opened in IE6.0. Erverything runs
                > > clientside without IIS.
                > >
                > > What the reason for that?
                > > Thanks for help![/color]
                >
                > This works on my Win98 IE6
                >
                > function showURL(adr) {
                > try {
                > var objDOM = new ActiveXObject(" Msxml2.DOMDocum ent");
                > objDOM.async = false;
                > alert('adr= '+adr);
                > if (objDOM.load(ad r))
                > alert(objDOM.xm l);
                > else
                > alert("Error: " + objDOM.parseErr or.reason);
                > }
                > catch(e) {
                > alert("Error: " + e);
                > }
                > } *[/color]

                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

                Comment

                • sinna

                  #9
                  Re: access denied


                  mscir wrote:[color=blue]
                  > *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.DOMDocum ent.4.0");
                  > xmlDoc.async = false;
                  > xmlDoc.resolveE xternals = false;
                  > xmlDoc.load("C: \\WINDOWS\\SYST EM\\wmpscheme.x ml");
                  > if (xmlDoc.parseEr ror.errorCode != 0) {
                  > var myError = xmlDoc.parseErr or;
                  > alert('Error: '+myErr.reason) ;
                  > }
                  > else
                  > alert(xmlDoc.xm l);
                  > }
                  >
                  > Good Luck,
                  > Mike *[/color]

                  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.DOMDocu ment.4.0' to 'Msxml2.DOMDocu ment')

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

                  thank you
                  Andrea


                  -
                  sinn

                  Comment

                  • sinna

                    #10
                    Re: access denied


                    mscir wrote:[color=blue]
                    > *sinna wrote:
                    > <snip>[color=green]
                    > > Is there any security option that has to be changed, so that J[/color]
                    > cann[color=green]
                    > > access local files?[/color]
                    >
                    > 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
                    > *[/color]

                    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

                    Comment

                    • sinna

                      #11
                      Re: access denied


                      sinna wrote:[color=blue]
                      > *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 *[/color]

                      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

                      Comment

                      • sinna

                        #12
                        Re: access denied


                        sinna wrote:[color=blue]
                        > *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.DOMDocu ment.4.0' t
                        > 'Msxml2.DOMDocu ment')
                        >
                        > I believe that maybe a option in the IE could be the solution.
                        >
                        > thank you
                        > Andreas *[/color]


                        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

                        Comment

                        • mscir

                          #13
                          Re: access denied

                          sinna wrote:[color=blue]
                          > sinna wrote:[/color]
                          <snip>[color=blue]
                          > 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?[/color]

                          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.publi c.xml
                          microsoft.publi c.inetserver.ii s.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?



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

                          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:



                          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:



                          Good Luck,
                          Mike

                          Comment

                          • sinna

                            #14
                            Re: access denied


                            mscir wrote:[color=blue]
                            > *sinna wrote:[color=green]
                            > > sinna wrote:[/color]
                            > <snip>[color=green]
                            > > It works if the files are an a network drive, but if the are on[/color]
                            > local[color=green]
                            > > drive I got a error "ACCESS DENIED". Seems to be problem with th[/color]
                            > access rights.[color=green]
                            > > Any ideas?[/color]
                            >
                            > 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.publi c.xml
                            > microsoft.publi c.inetserver.ii s.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 *[/color]


                            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

                            Comment

                            • mscir

                              #15
                              Re: access denied

                              sinna wrote:
                              <snip>[color=blue]
                              > I found a solution, but I don't realy understand what is the big
                              > difference. I attached my solution.[/color]

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

                              Comment

                              Working...