Microsoft KB Archive/297373

= Logon errors occur when you connect to a SQL Server database from a Microsoft Access project =

Article ID: 297373

Article Last Modified on 4/12/2007

-

APPLIES TO


 * Microsoft Office Access 2007
 * Microsoft Office Access 2003
 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q297373



Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies only to a Microsoft Access project (.adp).



SYMPTOMS
When you try to connect to a Microsoft SQL Server database from a Microsoft Access project (ADP), you may receive the following error:

Microsoft Access could not find the database on the server. Verify that the database name is correct.

If you click the Test Connection button in the Data Link Properties dialog box, you receive the following error message:

Test connection failed because of an error in initializing provider. Cannot open database requested in login. Login Fails.



CAUSE
The specified user account has not been granted permissions to the SQL Server database that you are trying to connect to.



With a Full Installation of SQL Server
Grant permission for the specified account on the database that you are trying to connect to. Access projects can connect to SQL Server through a specific SQL Server user or by using a network domain account. With full installations of SQL Server, you can use Enterprise Manager to create user accounts and grant permissions.

With SQL Server 2000 Desktop Engine
A SQL Server 2000 Desktop Engine installation does not include Enterprise Manager. Addionally, by default, SQL Server 2000 Desktop Engine is configured to allow only members of the local Windows NT or Windows 2000 administrators group or the SQL Server Administrator account, &quot;sa,&quot; to access the database.

To grant permissions to the database in SQL Server 2000 Desktop Engine, you can use the following options:
 * You can use Integrated Security to add the user who is running the Access project to the Windows NT or Windows 2000 local administrators group. However, this also gives the user full access to the computer.
 * You can enable the &quot;sa&quot; account with a password and allow the user to log on as a SQL Server Administrator. The user will have full access to the SQL Server, but not full access to the Windows NT-based computer or the Windows 2000-based computer.
 * You can install SQL Server Enterprise Manager from the SQL Server 7.0 or SQL Server 2000 compact disc. This gives you the management tools to add network domain users to the database and to provide security at the object level.
 * You can install Microsoft Office XP Developer. Microsoft Office XP Developer includes the SQL Server client tools, including Enterprise Manager.
 * You can execute SQL Server stored procedures to grant access to the database.



STATUS
This behavior is by design in a Microsoft Access project.



MORE INFORMATION
By default, when you run SQL Server 2000 Desktop Engine on Microsoft Windows NT 4.0 or Microsoft Windows 2000, SQL Server 2000 Desktop Engine Setup configures the installed instance of Microsoft SQL Server to use Windows Authentication and places the Windows local administrator's group in the SQL Server sysadmin fixed server role. When you run SQL Server 2000 Desktop Engine on Microsoft Windows 98, SQL Server 2000 Desktop Engine Setup always configures the installed instance to use SQL Server Authentication.

To allow access to the database, you must grant the user permissions. For integrated security, you must make the user a member of the local admins group on the Windows 2000 server. For Windows 98, you must use the SQL Server administrative account, &quot;sa.&quot;

There are additional options that you can use to provide more restricted security. These involve installing Enterprise Manager or executing SQL Server stored procedures to create logons and database access rights.

These additional options are covered in more detail in the &quot;Configuring SQL Server 2000 Desktop Engine&quot; white paper. You can download this white paper from the following Microsoft Web site:

http://download.microsoft.com/download/Access2002/whitepap/2002/WIN98Me/EN-US/AccSQL02.exe

Steps to Reproduce the Behavior

 * 1) Use Enterprise Manager to create two new databases on SQL Server. Name them Test1 and Test2.
 * 2) Create a new logon. Set its default database as Test1.
 * 3) Add this new logon as a database user on Test1.
 * 4) Create a new Access project (existing data).
 * 5) In step 1 of the Data Link Properties dialog box, select your server. In step 2, click Use a specific user name and password. Then, enter the user name and password of your new user.
 * 6) Click Test Connection to verify that the connection works.
 * 7) In step 3 of the Data Link Properties dialog box, select the Test1 database. Then, click Test Connection. Note that the connection works.
 * 8) In step 3 of the Data Link Properties dialog box, select the Test2 database. Note that you receive the second error message that is mentioned in the &quot;Symptoms&quot; section of this article.
 * 9) Click OK to the error message that you receive in step 8. Then, click OK in the Data Link Properties dialog box. Note that you receive the first error message that is mentioned in the &quot;Symptoms&quot; section of this article.

