Microsoft KB Archive/268710

From BetaArchive Wiki
Knowledge Base


PRB: Error Message "Unspecified Error Was Not Handled" When You Use Visual InterDev to Debug ASP Page

Article ID: 268710

Article Last Modified on 10/15/2002



APPLIES TO

  • Microsoft ActiveX Data Objects 1.5
  • Microsoft ActiveX Data Objects 2.0
  • Microsoft ActiveX Data Objects 2.01
  • Microsoft ActiveX Data Objects 2.1
  • Microsoft ActiveX Data Objects 2.1 Service Pack 1
  • Microsoft ActiveX Data Objects 2.1 Service Pack 2
  • Microsoft ActiveX Data Objects 2.5
  • Microsoft Visual InterDev 6.0 Standard Edition



This article was previously published under Q268710

SYMPTOMS

When you debug an Active Server Page (ASP) page by using the Visual InterDev debugger, you encounter one of the following error messages if the page creates a connection to a Microsoft Access database:

An exception of type MS Jet Database Engine: Unspecified error was not handled.

-or-


An exception of type 'Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC Microsoft Access Driver] Disk or network error.' was not handled.

CAUSE

When a connection to an Access database is established, Microsoft Jet creates a temporary file by using the credentials of the Thread identity. (Unless Anonymous access is disabled for the application, this identity is the IUSR account.)

To do this, Jet first checks the TMP or TEMP environment variable and uses that path to define where the temporary file is created. If the Thread identity user does not have appropriate access to the temp folder, one of the errors messages in the "Symptoms" section may occur.

RESOLUTION

All of the following are possible workarounds for this issue:

  1. Disable Anonymous access to the directory, and enable either Basic access or Windows Integrated access. If you enable Basic, enter the credentials for the user that you are logged in as to ensure that the Thread identity is the same as the console and process identity. If you enable Windows Integrated, you do not need to enter the same credentials as the console identity; these are used automatically. This account has access to its temp folder.


To disable Anonymous and enable either Basic or Windows Integrated, follow these steps:

    1. In Internet Services Manager, right-click the folder for your application, and then select Properties.
    2. On the Security tab in the Directory, click Edit for Anonymous access and authentication control.
    3. Deselect Anonymous Access, and then select either Basic authentication or Integrated Windows authentication. (For Internet Information Server (IIS) 4.0, select Windows NT Challenge/Response.)
  1. Debug as a different user than the user who is logged in to the computer. Because the console identity (user logged in to the computer) and the process identity (user you are debugging as) are different in this scenario, Jet uses the system temp folder to which the IUSR (Thread identity) account must have access.
  2. Give the IUSR account sufficient NTFS file system permissions to create a file in the temp folder of the specific user. To determine the location of the temp folder, following these steps:
    1. On the command line, type set.
    2. In the list of settings, note that there are two entries titled Temp= and Tmp=; this is the path that Jet uses.


MORE INFORMATION

The temp folder that is used depends on the combination of the Console identity (the user logged in to the Web server) and the Process identity (the user you are debugging as). The following table outlines the different scenarios, and shows which temp folder is used:

Console Process Thread TEMP Directory/Environment Variable used
UserA UserA IUSR TMP/TEMP User variable for userA (such as %UserAProfile%\Local Settings\Temp)
UserA IWAM IUSR TMP/TEMP System variable (such as %SystemRoot%\temp)
UserA SYSTEM IUSR TMP/TEMP System variable (such as %SystemRoot%\temp)


In each scenario, except the first, the temp directory that is used is the one that is specified as the system temp folder. By default, this folder is C:\winnt\System\temp. You can verify the folder setting by using the following steps:

On Microsoft Windows 2000:

  1. Right-click My Computer on the Desktop of the Web Server computer, and click Properties on the Context menu.
  2. In the System Properties dialog box, select the Advanced tab, and then click Environment Variables.
  3. In the Environment Variables dialog box, scroll through the System Variables list until you see the value of the TMP or TEMP variable. If this variable is not available in the System Variables list, look for it in the User Variables list.

On Microsoft Windows NT 4:

  1. Right-click My Computer on the Desktop of the Web Server computer, and click Properties on the Context menu.
  2. In the System Properties dialog box, select the Environment tab.
  3. In the Environment Variables dialog box, scroll through the System Variables list until you see the value of the TMP or TEMP variable. If this variable is not available in the System Variables list, look for it in the User Variables list.NOTE: If no TMP or TEMP variable is listed, the Windows directory (usually \WINNT or \Windows) is used as the temporary folder.


However, in the first scenario, Jet tries to create the temporary file in the specific user's temp folder using the IUSR account because the console and process identity is the same. Normally, the IUSR account does not have the appropriate access to this user's temp folder; this causes the error message to occur.


REFERENCES

For additional information about related debuggingarticles, click the article number below to view the article in the Microsoft Knowledge Base:

244272 INFO: Visual InterDev 6.0 Debugging Resources


For additional information about related Access articles, click the article number below to view the article in the Microsoft Knowledge Base:

251254 PRB: Disk or Network Error or Unspecified Error Returned When Using Jet


Keywords: kbbug kbwebserver kbserver kbdatabase kbdebug kbprb KB268710