Microsoft KB Archive/934364

= You may receive an &quot;Access is denied&quot; error message when you try to access a Web page that contains a script in Internet Explorer 6 =

Article ID: 934364

Article Last Modified on 11/22/2007

-

APPLIES TO


 * Microsoft Internet Explorer 6.0
 * Microsoft Windows XP Service Pack 2
 * Microsoft Windows Server 2003 Service Pack 1

-



SYMPTOMS
Consider the following scenario:
 * You have a computer that is running Microsoft Windows XP with Service Pack 2 (SP2) or Windows Server 2003 with SP1.
 * You try to access a Web page in Microsoft Internet Explorer 6.
 * The Web page contains a script.

In this scenario, you may receive the following error message:

Line:

Char:

Error: Access is denied

Code: 0

URL: file:/// URLPath/

The following line in the script code raises the error message. event.KeyCode = 0;



CAUSE
This problem occurs when you try to access a Web page from the local file system, and the local file system contains the event.KeyCode property in the script. This is a security change in Internet Explorer 6 on Windows XP with SP2 and on Windows Server 2003 with SP1. You can no longer access the event.keyCode property by using the SHIFT key or the CTRL key on Web pages that are loaded from the local disk.



RESOLUTION
To resolve this problem, change the code that assigns the event.keyCode property so that it does not change the value. The change in the code lets you use the SHIFT key or the CTRL key to load pages from the local disk

Alternatively, you can host the Web pages on a Web server. This makes sure that the event.keyCode property in the script runs correctly.



STATUS
This behavior is by design.



Steps to reproduce the problem
 Install Windows XP with SP2 or Windows Server 2003 with SP1.  Paste the following code in a text file, and then save the file as TestKeyCode.htm on the local hard disk.    function onJScriptKeyDown { event.keyCode = 0; }  

 Test  </BODY>

</HTML> </li> Open the TestKeyCode.htm file in Internet Explorer 6 by using the file protocol.

For example, type the following address in the Address bar:

file:/// C :/TestKeyCode.htm

</li> Click the Test box to set the focus.</li> Press SHIFT or press CTRL.</li></ol>

<div class="references_section">