BUG: Error 15211 from sp_password if SET ANSI_NULLS Is On

ID: Q153301


The information in this article applies to:


SYMPTOMS

If a client computer has SET ANSI_NULLS ON and attempts to issue the procedure sp_password to change a password which is currently NULL, the attempt will fail with a 15211 error. Any attempt to change a null password using sp_password through the Microsoft SQL Server ODBC version 2.65.0201 driver results in the error:

SQLState = 37000, pfNative = 15211
szErrorMsg = '[Microsoft][ODBC SQL Server Driver][SQL Server]
Old (current) password incorrect for user - password not changed.'


CAUSE

When running against SQL Server 6.5, the Microsoft SQL Server ODBC version 2.65.0201 driver always issues the command SET ANSI_DEFAULTS ON in order to support the ODBC SQL standard, which is based on ANSI SQL. Setting ANSI_DEFAULTS on actually sets a number of ANSI options, including ANSI_NULLS, so users attempting to change a NULL password with sp_password through the ODBC driver will always encounter this error.


WORKAROUND

DB-Library clients such as ISQL/w or Enterprise Manager can do the following:


   SET ANSI_NULLS OFF
   EXEC sp_password NULL,...
   SET ANSI_NULLS ON 

Sites should not use ODBC to issue sp_password against SQL Server 6.0.


STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.50.0201. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Additional query words: SQLExecute


Keywords          : kbbug6.50 
Version           : 6.5
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: March 30, 1999