FP2000: "Connection Undefined" Error When You View an Active Server Page in the Web Browser (265174)



The information in this article applies to:

  • Microsoft FrontPage 2000

This article was previously published under Q265174

SYMPTOMS

When you attempt to view an Active Server Page (ASP) in the Web browser, you may receive an error message similar to the following:
Database Results Error
The database connection named "Database1" is undefined.

CAUSE

This behavior can occur if the Global.asa does not execute as expected.

RESOLUTION

To resolve this issue, use the following Active Server Page code to verify whether Active Server Pages are working and to test whether the Global.asa is executing with the Microsoft FrontPage connection information.

NOTE:
  • Replace XXX in the following code example with your database connection name (for example, the SAMPLE database connection will be Sample_ConnectionString.)

  • You may receive an error message if you copy and paste the example directly from this article to FrontPage. The angle brackets ("<" and ">") may appear as escaped HTML code ("<" and ">"). To work around this behavior, paste the script in a blank Notepad document, and then copy it from Notepad before pasting it into FrontPage.

Sample Code

<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body>

<p>TIME: <% =Time() %></p>

<!-- Replace XXX with the name of your database connection. -->
<p>DATA: <% =Application("XXX_ConnectionString") %></p>

</body>
</html>
				
The preceding code tests whether the following are true:
  • The =Time() function returns the correct time on the server if Active Server Pages are functioning at all.

  • The =Application() variable returns the necessary connection information for the program.
For example, the code may return something like the following:

TIME: 4:10:38 PM
DATA: DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\inetpub\wwwroot\fpdb\fpnwind.mdb
					

If the =Application() variable returns nothing after "DATA:", one of the following conditions is true:
  • The Global.asa file is not being executed; this is probably because of the folder not being configured as a program. (See the "More Information" section for additional information.)

  • The Connection String in the ASP code is not defined in the Web settings.

MORE INFORMATION

:

204152 FP2000: Database Connection Undefined After Publishing Web

219170 FP2000: Error Browsing Database Results Pages After Publishing from Disk-Based Web

In addition, the following article contains more information on this subject. Although this article references Microsoft Visual InterDev, in this instance it can apply to FrontPage if the code returns data for the =Time() function, but does not return data for the =Application() variable.

188715 Global ASA Not Firing When Visual InterDev Made IIS 4.0 Application


Modification Type:MajorLast Reviewed:8/27/2002
Keywords:kbprb KB265174