SAP Knowledge Base Article - Public

3554471 - Error: Logon failed: 'IM006:[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed [Database Vendor Code: 18456 ] when attempting to connect to MS SQL Server from Crystal Reports

Symptom

  • Logon failed.
  • Fails to connect to MS SQL Server.
  • When attempting to connect to MS SQL Server from Crystal Reports via ODBC, it fails with the following errors:

    "Logon failed."

    Followed by the errors:

    "Database Connection Error: 28000:[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user '<USER NAME>'. [Database Vendor Code: 18456]"

    "Database Connector Error: 'IM006:[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed [Database Vendor Code: 18456 ]'
    01S00:[Microsoft][ODBC Driver 17 for SQL Server]Invalid connection string attribute [Database Vendor Code: 18456 ]

Environment

  • SAP Crystal Reports 2016
  • SAP Crystal Reports 2020
  • SAP Crystal Reports 2025
        
  • MS SQL Server 2016
  • MS SQL Server 2017
  • MS SQL Server 2019
  • MS SQL Server 2022

Reproducing the Issue

  1. In Microsoft ODBC Data Source Administrator, create an ODBC DSN to MS SQL Server
  2. In Crystal Reports, create a new report using an ODBC Connection.
  3. Select the ODBC DSN to MS SQL Server.
  4. Enter the database user name and password.
  5. It then generates the error: Logon failed...

Cause

  • To connect to a database via ODBC, Crystal Reports uses a connection string in the following format:

       DSN=<ODBC DSN Name>;UID=<Database User>;PWD=<Database Password>;DATABASE=<Database>

  • The error occurs when the Database Password contains the special character, semi-column ( ; ) because it is a reserved character to delimiter each argument in a connection string to a database. By consequent, the incorrect password is sent to the database, because only the string of characters before the semi-column is sent to the database, which causes a login failed error.

Resolution

  • In Microsoft SQL Server, change the MS SQL Server user password to not include the special character semi-column ( ; )

Keywords

CR, logon failed , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports 2016 ; SAP Crystal Reports 2020 ; SAP Crystal Reports 2025