Database Error executing query when NETE_ODBC_NATIVE is set to yes using MSSQL ODBC DataDirect driver as User Store
search cancel

Database Error executing query when NETE_ODBC_NATIVE is set to yes using MSSQL ODBC DataDirect driver as User Store

book

Article ID: 435096

calendar_today

Updated On:

Products

SITEMINDER CA Single Sign-On

Issue/Introduction

Running a Policy Server, when setting NETE_ODBC_NATIVE to yes, then the MSSQL Server as user store stops to work.

The Policy Server reports the following error:

smps.log:

[4464/4312][Tue Mar 24 2026 10:40:06.781][SmAuthServer.cpp:390][INFO][sm-Server-02760] Initialized authentication scheme <authentication_scheme>
[4464/5224][Tue Mar 24 2026 10:45:35.277][SmDsOdbcProvider.cpp:1194][ERROR][sm-Odbc-00170] Database Error executing query ( 'select Name from dbo.<querystatement>'). Error: Internal Error: DB Transport Error.  Code is -4017 (DBMSG: <<<State = 08S01 Internal Code = 0 - s>>>) .

Cause

The Native Driver isn't configured completely, and as such, that caused the errors.

To reproduce this issue:

First, configure a Datadirect driver MSSQL 2022 User Directory called "<userstore>".

smps.log:

[10088/484][Fri Mar 27 2026 12:04:30.038][SmAuthServer.cpp:361][INFO][sm-Server-02750] Loaded authentication scheme Basic. Version 768 . SiteMinder(tm) Directory Credentials authentication scheme
[10088/8976][Fri Mar 27 2026 12:05:31.401][CSmDbSessionManager.cpp:553][INFO][sm-Server-04350] Using ODBC 'User Store' data source '<userstore>'.
[10088/10060][Fri Mar 27 2026 12:05:31.401][SmAuthServer.cpp:390][INFO][sm-Server-02760] Initialized authentication scheme Basic

Second, switch to the Native ODBC driver on the Policy Server on Windows, only by configuring the environment variable.

Add the environment variable as system variable (1):

NETE_ODBC_NATIVE  Yes

Then, the driver stopped to work correctly.

The Policy Server reports the error "Database Error executing query".

smps.log:

[8700/8856][Fri Mar 27 2026 12:30:37.048][CSmDbSessionManager.cpp:553][INFO][sm-Server-04350] Using ODBC 'User Store' data source '<userstore>'.
[8700/9388][Fri Mar 27 2026 12:30:37.049][SmAuthServer.cpp:390][INFO][sm-Server-02760] Initialized authentication scheme Basic<user>
[8700/9388][Fri Mar 27 2026 12:30:37.352][SmDsOdbcProvider.cpp:1194][ERROR][sm-Odbc-00170] Database Error executing query ( 'SELECT <column> FROM <table> WHERE <column> = '<user>''). Error: Internal Error: Database error.  Code is -4007 (DBMSG: <<<State = HY000 Internal Code = 2713 - s>>>) .

And this is expected, as the ODBC Native Driver for MSSQL needs to be further configured (1).

Configuring the ODBC connection to use Native Driver (2):

  • Select ODBC Driver 18 for SQL Server;
  • Set "With SQL Server authentication using a login ID and password entered by the user and provider username and password;
  • Change the default database to:
    selected <userstore>;
  • Select Optional from "Connection Encryption";  
  • Click on "Test Data Source..."
    Microsoft ODBC Driver for SQL Server Version 18.06.0001
    Running connectivity tests...
    Attempting connection
    Connection established
    Verifying option settings
    Disconnecting from server
    TESTS COMPLETED SUCCESSFULLY!
  • Restart the Policy Server;

Having the environment variable and the ODBC driver configured for the Native one, then the authentication works as expected as the Policy Server reports it.

smps.log:

[6516/7612][Fri Mar 27 2026 12:59:20.376][SmAuthServer.cpp:361][INFO][sm-Server-02750] Loaded authentication scheme Basic. Version 768 . SiteMinder(tm) Directory Credentials authentication scheme
[6516/7844][Fri Mar 27 2026 12:59:27.489][CSmDbSessionManager.cpp:553][INFO][sm-Server-04350] Using ODBC 'User Store' data source '<userstore>'.
[6516/7612][Fri Mar 27 2026 12:59:27.490][SmAuthServer.cpp:390][INFO][sm-Server-02760] Initialized authentication scheme Basic

Resolution

Follow the documentation to configure the ODBC Native driver for MSSQL 2022 on Windows (1)(2).

Additional Information

  1. Switch from DataDirect Drivers to Native Drivers

  2. (From Release 12.9) Configure a SQL Server Data Source Using Native Drivers on Windows