You receive an "Internet Server Error" error message when you open a three-tier data access page by using the ShowModalDialog method (827427)



The information in this article applies to:

  • Microsoft Access 2002



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:
  1. Start Microsoft Access.
  2. Open the Northwind.mdb sample database.
  3. Create a ParentPage.htm data access page that is based on the Categories table. To do this, follow these steps:
    1. In the Database window, click Pages under Objects.
    2. In the right pane, double-click Create data access page by using wizard.
    3. In the Page Wizard dialog box, click to select Table: Categories on the Tables/Queries list.
    4. Click the >> button to move all the fields from the Available Fields list to the Selected Fields list. Click Finish.
    5. Set the page properties as follows:

      PropertyValue
      ConnectionFile<Valid data source (*.odc) pointing to the current database>
      UseRemoteProviderTrue
    6. On the View menu, click HTML Source.
    7. In Microsoft Script Editor, add the following code in the HEAD tag:
      <SCRIPT language=JavaScript>
      <!--
      
      var x;
      
      function test(catid)
      {
      	document.all("MSODSC").recordsetdefs(0).serverfilter="[CategoryID]=" + catid;
      	x=null;
      }
      
      function child()
      {
      	if(x!=null)
      	{
      		x.focus();
      	}
      }
      
      function showwindow()
      {
      	x=window.open("ChildPage.htm",null,"height=500,width=500,left=300,top=150,status=yes,toolbar=no,menubar=no,location=no");
      }
      
      -->
      </SCRIPT>
      
    8. Add the following code in the Body tag:
      <FORM NAME=testform METHOD=get ACTION=>
       <BUTTON onclick='showwindow()'>Show Modal Window</BUTTON><BR>
      </FORM>
    9. Close Microsoft Script Editor.
    10. Save the data access page. Name the data access page ParentPage.htm.
  4. Create a ChildPage.htm data access page that is based on the Categories table. To do this, follow these steps:
    1. In the Database window, click Pages under Objects.
    2. In the right pane, double-click Create data access page by using wizard.
    3. In the Page Wizard dialog box, click to select Table: Categories on the Tables/Queries list.
    4. Click the >> button to move all the fields from the Available Fields list to the Selected Fields list. Click Finish.
    5. Set the page properties as follows:

      PropertyValue
      ConnectionFile<Valid data source (*.odc) pointing to the current database>
      UseRemoteProviderTrue
    6. On the View menu, click HTML Source.
    7. In Microsoft Script Editor, add the following code in the HEAD tag:
      <SCRIPT language=JavaScript>
      <!--
      function catid()
      {
      catid=window.opener.test(document.all("CategoryID").value);
      window.close();
      }
      -->
      </SCRIPT>
      
    8. Modify the Body tag to the following format:
      <BODY style="OVERFLOW: auto" vLink=#800080 link=#0000ff onunload=catid()>
    9. Add the following code in the Body tag:
      <BUTTON onclick=catid()>Back</BUTTON>
      
    10. Close Microsoft Script Editor.
    11. Save the data access page. Name the page ChildPage.htm.
  5. 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:
    • http://localhost/ParentPage.htm
    • http://localhost/ChildPage.htm
  6. Open ParentPage.htm in Internet Explorer by using the following URL:

    http://localhost/ParentPage.htm

  7. 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.
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.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article.

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:

Steps to reproduce the behavior

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

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

      PropertyValue
      ConnectionFile<Valid data source (*.odc) pointing to the current database>
      UseRemoteProviderTrue
    6. Save the data access page. Name the page ChildPage.htm.
  5. 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:
    • http://localhost/ParentPage.htm
    • http://localhost/ChildPage.htm
  6. Open the ParentPage.htm in Internet Explorer by using the following URL:

    http://localhost/ParentPage.htm

  7. 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 "Symptoms" section of this article.

REFERENCES

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

300699 Common data access page deployment errors


291783 How To: Deploy data access pages over the Internet


Modification Type:MajorLast Reviewed:12/17/2003
Keywords:kbDAP kberrmsg kbprb KB827427 kbAudDeveloper