Sql connectionstring "Old Password" attribute not working on OLE DB Driver for SQL Server - getting error "Invalid connection string attribute"

Alice Van Rensburg 20 Reputation points
2025-05-19T14:28:00.7066667+00:00

Sql connectionstring "Old Password" attribute not working on OLE DB Driver for SQL Server - getting error "Invalid connection string attribute"

We have downloaded the OLE DB diver :

https://learn.microsoft.com/en-us/sql/connect/oledb/download-oledb-driver-for-sql-server?view=sql-server-ver16

In our connection string we added the Old Password attribute.

The connection string has the following structure:

'Provider=SQLOLEDB.1;Data Source=localhost;Initial Catalog=DatabaseName; User ID=UserName;Password=password;Old Password=oldpassword'

This gives the error: "Invalid connection string attribute"

However, when I install the ODBC driver:

https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-ver16

The "Old Password" attribute works.

'Provider=MSOLEDBSQL;Data Source=localhost;Initial Catalog=DatabaseName; User ID=UserName;Password=password;Old Password=oldpassword'

According to the documentation (https://learn.microsoft.com/en-us/sql/connect/oledb/features/changing-passwords-programmatically?view=sql-server-ver16)"learn.microsoft.com") - the Old Password attribute should work. We would like to avoid having to ask clients to deploy additional drivers if at all possibel.

Can somebody confirm that this should work with the OLE driver?

If it is designed to work with the OLE driver how do we fix the attribute issue?

SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
197 questions
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 121.3K Reputation points MVP Volunteer Moderator
    2025-05-19T21:09:00.4733333+00:00

    Actually, what it says in the note is this:

    In the connection string, the "Old Password" property sets SSPROP_AUTH_OLD_PASSWORD, which is the current (possibly expired) password that is not available via a provider string property.

    Note the last couple of words: is not available via a provider string property.

    The passage is certainly not crystal clear, least of all if you have never used the OLE DB interface directly, but you are using something on top of OLE DB. And in that case SSPROP_AUTH_OLD_PASSWORD may be off-limits to you.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Olaf Helper 47,416 Reputation points
    2025-05-19T14:33:45.1733333+00:00

    See

    https://www.connectionstrings.com/ole-db-driver-for-sql-server/

    for all valid parameters; "Old Password" isn't one.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.