Search code examples
sql-server-2008delphidelphi-2010adodbsql-server-native-client

PromptDataSource and password


I use PromptDataSource to allow users to setup a database connection.

connectionString := ADOdb.PromptDataSource(0, '');

However I can't get it to work with "Allow saving password" when using the SQL Server Native Client 10.0 provider:

enter image description here

PromptDataSource return a string with Persist Security Info=False, and the password is omitted, when using that provider:

Provider=SQNCLI10.1;Integrated Security="";Persist Security Info=False;User ID=MGH;Initial Catalog="";Data Source=stackoverflow.com;Initial File Name="";Server SPN=""

Other providers that I've tried worked, what can I do to fix this?

Note: I believe the provider is installed with MS SQL Server 2008 R2.


Solution

  • Edit: I forgot to include my answer: cannot be done.

    Not the answer you want to hear, but i am going to guess that it is an intentional bug - and you will not convince Microsoft to fix it.


    i can confirm that user supplied passwords work for:

    • Microsoft.Jet.OLEDB.4.0: Microsoft Jet 4.0 OLE DB Provider (works)
    • MSOLAP: Microsoft OLE DB Provider for Analysis Services 10.0 (works)
    • MSDASQL: Microsoft OLE DB Provider for ODBC Drivers (works)
    • MSDAORA: Microsoft OLE DB Provider for Oracle (works)
    • SQLOLEDB: Microsoft OLE DB Provider for SQL Server (works)
    • MSDataShape: MSDataShape (works)
    • SQLNCLI: SQL Server Native Client (works) (Released with 2005)

    and fail for

    • SQLNCLI10: SQL Server Native Client 10.0 (fails) (Released with 2008)
    • SQLNCLI11: SQL Server Native Client 11.0 (fails) (Released with 2012)

    It looks like Microsoft's broken by default policy again.

    Bonus Reading

    More of Microsoft's broken by default things: