Microsoft KB Archive/202037

= ACC2000: OpenDatabase Method Does Not Use Jet LoginTimeout =

Article ID: 202037

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q202037





This article applies only to a Microsoft Access database (.mdb).

Moderate: Requires basic macro, coding, and interoperability skills.

IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry



SYMPTOMS
The default ODBC Login timeout setting for Microsoft Jet databases is 20 and is stored, depending on the version, in the following registry key:

HKEY_LOCAL_MACHINE\SOFTWAREMicrosoft\Jet\4.0\Engines\ODBC\LoginTimeout

You can change this value from the default of 20; however, the new value will not be used in the OpenDatabase method of the current database, as in the following line: Set db=OpenDatabase("",false,false,"odbc;DSN=TEST" )



RESOLUTION
If you have changed the registry key to something other than the default of 20, and you want to use that new value with the OpenDatabase method, you should include the DBEngine object, as in the following line: set db=DBEngine.OpenDatabase("",false,false,"odbc;DSN=TEST" )



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

Steps to Reproduce Problem
 Create an ODBC System DSN named TEST that points to some ODBC database. In Control Panel, click the ODBC icon and start ODBC tracing. Delete the current ODBC trace file if one exists. Click Start, click Run, type regedit in the Open box, and then click OK. In Registry Editor, change the following registry key to 50 with a type of Decimal:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4\Engines\ODBC\LoginTimeout

</li> Open a Microsoft Access database and press CTRL+G.</li>  Type the following line of code in the Immediate window, and then press ENTER: Set db=DBEngine.OpenDatabase("",false,false,"odbc;DSN=TEST" ) </li> Open the ODBC trace file in Microsoft Notepad and look for SQLSetConnectOption with the <LoginTimeout> value.

Note that the DWORD value for <LoginTimeout> is 50. This indicates that the Microsoft Jet database engine is using the registry setting and calls SQLSetConnectOption with the LoginTimeout value of 50.</li> Close the database and delete the ODBC trace log.</li>  Open another Microsoft Access database and run the following line of code from the Immediate window: Set db=opendatabase("",false,false,"odbc;DSN=TEST" ) </li></ol>

Checking ODBC trace, note that the Jet database engine does NOT use the registry setting and calls SQLSetConnectOption with the default LoginTimeout value of 20.

Additional query words: pra

Keywords: kbbug kbnofix KB202037

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.