Microsoft KB Archive/199829

= ACC2000: OpenDatabase Method Doesn't Use the Jet LoginTimeout =

Article ID: 199829

Article Last Modified on 6/30/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q199829



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 keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\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. Open the ODBC tool in Control Panel and start ODBC tracing. Delete the current ODBC trace file if one exists. Click Start, click Run, type Regedit, and then press ENTER. In the Registry Editor, change the following registry key to 50 with a type of Decimal:

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

</li> Open a Microsoft Access database, and press CTRL+G to open the Immediate window.</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 Microsoft Jet 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, type the following line in the Immediate window, and then press ENTER:

Set db=OpenDatabase("",false,false,"odbc;DSN=TEST" )

Note that when you check ODBC trace, you see that Jet does NOT use the registry setting and calls SQLSetConnectOption with the default LoginTimeout value of 20.</li></ol>

Additional query words: pra doesn t does not

Keywords: kbbug kbfix KB199829

-

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

© Microsoft Corporation. All rights reserved.