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:
This
article applies to a Microsoft Access database (.mdb) and a Microsoft Access
project (.adp).
Advanced: Requires expert coding,
interoperability, and multiuser skills.
SYMPTOMSWhen 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. WORKAROUNDTo 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.
- Set
the page properties as follows:
Property | Value | ConnectionFile | <Valid data source (*.odc)
pointing to the current database> | UseRemoteProvider | True |
- On the View menu, click HTML
Source.
- 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>
- Add the following code in the Body tag:
<FORM NAME=testform METHOD=get ACTION=>
<BUTTON onclick='showwindow()'>Show Modal Window</BUTTON><BR>
</FORM> - Close Microsoft Script Editor.
- Save the data access page. Name the data access page ParentPage.htm.
- Create
a ChildPage.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.
- Set
the page properties as follows:
Property | Value | ConnectionFile | <Valid data source (*.odc)
pointing to the current database> | UseRemoteProvider | True |
- On the View menu, click HTML
Source.
- 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>
- Modify the Body tag to the following format:
<BODY style="OVERFLOW: auto" vLink=#800080 link=#0000ff onunload=catid()> - Add the following code in the Body tag:
<BUTTON onclick=catid()>Back</BUTTON>
- Close Microsoft Script Editor.
- Save
the data access page. Name the page ChildPage.htm.
- Copy the ParentPage.htm data access page and the
ChildPage.htm data access page to the following directory: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
- Open ParentPage.htm in Internet Explorer by using the
following URL:
http://localhost/ParentPage.htm - 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. STATUSMicrosoft
has confirmed that this is a problem in the Microsoft products that are listed
in the "Applies to" 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: | Major | Last Reviewed: | 12/17/2003 |
---|
Keywords: | kbDAP kberrmsg kbprb KB827427 kbAudDeveloper |
---|
|