Microsoft KB Archive/827427

= You receive an &quot;Internet Server Error&quot; error message when you open a three-tier data access page by using the ShowModalDialog method =

Article ID: 827427

Article Last Modified on 12/17/2003

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article applies to a Microsoft Access database (.mdb) and a Microsoft Access project (.adp).

Advanced: Requires expert coding, interoperability, and multiuser skills.



SYMPTOMS
When you try to open a three-tier data access page in a modal window from another three-tier data access page by using the ShowModalDialog method, you may receive one of the following error messages:

Internet Server Error

Internet Client Error: Cannot Connect to Server.



WORKAROUND
To work around this problem, open the three-tier data access page without using the ShowModalDialog method in the parent data access page script. To do this, follow these steps:  Start Microsoft Access. Open the Northwind.mdb sample database. Create a ParentPage.htm data access page that is based on the Categories table. To do this, follow these steps:  In the Database window, click Pages under Objects. In the right pane, double-click Create data access page by using wizard. In the Page Wizard dialog box, click to select Table: Categories on the Tables/Queries list. Click the >> button to move all the fields from the Available Fields list to the Selected Fields list. Click Finish.</li> Set the page properties as follows:

</li> On the View menu, click HTML Source.</li>  In Microsoft Script Editor, add the following code in the HEAD tag: <SCRIPT language=JavaScript>

</SCRIPT> </li>  Add the following code in the Body tag: <FORM NAME=testform METHOD=get ACTION=> <BUTTON onclick='showwindow'>Show Modal Window</BUTTON><BR> </FORM> </li> Close Microsoft Script Editor.</li> Save the data access page. Name the data access page ParentPage.htm .</li></ol> </li> Create a ChildPage.htm data access page that is based on the Categories table. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> In the Database window, click Pages under Objects.</li> In the right pane, double-click Create data access page by using wizard.</li> In the Page Wizard dialog box, click to select Table: Categories on the Tables/Queries list.</li> Click the >> button to move all the fields from the Available Fields list to the Selected Fields list. Click Finish.</li> Set the page properties as follows:

</li> On the View menu, click HTML Source.</li>  In Microsoft Script Editor, add the following code in the HEAD tag: <SCRIPT language=JavaScript>

</SCRIPT> </li>  Modify the Body tag to the following format: <BODY style=&quot;OVERFLOW: auto&quot; vLink=#800080 link=#0000ff onunload=catid> </li> <li> Add the following code in the Body tag: <BUTTON onclick=catid>Back</BUTTON> </li> <li>Close Microsoft Script Editor.</li> <li>Save the data access page. Name the page ChildPage.htm .</li></ol> </li> <li>Copy the ParentPage.htm data access page and the ChildPage.htm data access page to the following directory:

C:\Inetpub\wwwroot

Note Verify that you can view the data access pages in Microsoft Internet Explorer by using URLs that are similar to the following URLs: <ul> <li>http://localhost/ParentPage.htm</li> <li>http://localhost/ChildPage.htm</li></ul> </li> <li>Open ParentPage.htm in Internet Explorer by using the following URL:

http://localhost/ParentPage.htm

</li> <li>Click Show Modal Dialog in the data access page.

ChildPage.htm opens successfully.

Note The ShowModalDialog method simulates a modal dialog box. When you click ParentPage.htm, the focus returns to ChildPage.htm. When you click the Back button on ChildPage.htm, the focus returns to ParentPage.htm. However, the ShowModalDialog method does not create a pure modal dialog box. Therefore, any code that is running on the parent page does not stop running until you close the dialog box.</li></ol>

To run code after the modal dialog box is handled, write the code in the test function in ParentPage.htm that is called from the ChildPage.htm page.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section of this article.

<div class="moreinformation_section">

MORE INFORMATION
A modal dialog box retains the input focus while the dialog box is open. You cannot switch windows until you close the dialog box. You can use the ShowModalDialog method to create a modal dialog box.

For more information about the ShowModalDialog method, visit the following Microsoft Web site:

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/showmodaldialog.asp

<div class="moreinformation_section">

Steps to reproduce the behavior
<ol> <li>Start Microsoft Access.</li> <li>Open the Northwind.mdb sample database.</li> <li>Create a ParentPage.htm data access page that is based on the Categories table. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>In the Database window, click Pages under Objects.</li> <li>In the right pane, double-click Create data access page by using wizard.</li> <li>In the Page Wizard dialog box, click to select Table: Categories on the Tables/Queries list.</li> <li>Click the >> button to move all the fields from the Available Fields list to the Selected Fields list. Click Finish.</li> <li>Add a Command0 command button to the data access page, and then set the InnerText property of the button to Show Modal Dialog.</li> <li>Set the page properties as follows:

</li> <li>On the View menu, click HTML Source.</li> <li> In Microsoft Script Editor, add the following code in the HEAD tag: <SCRIPT language=vbscript event=onclick for=Command0> Test = showModalDialog(&quot;http://localhost/ChildPage.htm&quot;,&quot;&quot;,&quot;dialogHeight:560px;dialogWidth:600px;center:yes; resizeable:yes&quot;) </SCRIPT> </li> <li>Close Microsoft Script Editor.</li> <li>Save the data access page. Name the page parentPage.htm .</li></ol> </li> <li>Create a ChildPage.htm data access page that is based on the Categories table. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>In the Database window, click Pages under Objects.</li> <li>In the right pane, double-click Create data access page by using wizard.</li> <li>In the Page Wizard dialog box, click to select Table: Categories on the Tables/Queries list.</li> <li>Click the >> button to move all the fields from the Available Fields list to the Selected Fields list, and then click Finish.</li> <li>Set the page properties as follows:

</li> <li>Save the data access page. Name the page ChildPage.htm .</li></ol> </li> <li>Copy the ParentPage.htm data access page and the ChildPage.htm data access page to the following directory:

C:\Inetpub\wwwroot

Note Verify that you can view the data access pages in Internet Explorer by using URLs that are similar to the following URLs: <ul> <li>http://localhost/ParentPage.htm</li> <li>http://localhost/ChildPage.htm</li></ul> </li> <li>Open the ParentPage.htm in Internet Explorer by using the following URL:

http://localhost/ParentPage.htm

</li> <li>Click Show Modal Dialog in the data access page.

When you try to open the ChildPage.htm data access page by using the ShowModalDialog method in the ParentPage.htm, you receive one of the error messages that are mentioned in the &quot;Symptoms&quot; section of this article.</li></ol>

<div class="references_section">