INF: IIS Queries to SQL Server Generate Error 1326

Last reviewed: May 5, 1997
Article ID: Q152828
The information in this article applies to:
  • Microsoft SQL Server, versions 4.21, 6.0 and 6.5

SUMMARY

When you use anonymous connections for IIS and you attempt to query remote SQL servers using named pipes, the following error may occur:

   [State =01000][Error=1326][Microsoft][ODBC SQL Server Driver]
   [SQL Server][dbnmpntw] ConnectionOpen (CreateFile())

Error 1326 means "Logon failure: unknown user name or bad password." This error is raised because the IIS Service does not have any rights to use the named pipe.

MORE INFORMATION

In order for a SQL server client to gain access to a Windows NT named pipe, the client needs to be validated by the Windows NT server. This is normally accomplished through a Workgroups style validation method where identical usernames and passwords are created on the client and the server, or the domain method where both the client and server are domain members.

The Internet Information Server (IIS) setup process creates a Windows NT ID called IUSR_machinename (where machinename is the name of the Windows NT server), and adds that user to the Guest local group. The IIS service runs under this Windows NT account name.

If the connection to IIS is anonymous, IIS uses the Windows NT account IUSR_machinename and so any network activity performed by IIS is done under this account ID.

If the SQL server resides on the same server as IIS, then named pipes connections work and validation is successful.

If the SQL server resides on a separate server from IIS, then the IUSR_machinename account needs to be validated on the Windows NT server that SQL resides on.

This validation can be implemented by several methods:

  • Add the account to the local user account database on the NT server that SQL resides on.
  • Make the Windows NT ID IUSR_machinename a member of the domain that the SQL server resides in.
  • Enable the Windows NT ID Guest.

For more information regarding security and Microsoft Internet Information Server, please refer to the following article in the Microsoft Knowledge Base:

Article-ID: Q142868

TITLE     : IIS: Authentication & Security Features


Additional query words: ODBC IIS
Version : 4.21 6.0 6.5
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 5, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.