SQLAllocHandle of the driver on SQL_HANDLE_ENV failed when connecting to IBM-DB2 database
Mostrar comentarios más antiguos
In Matlab R2022a, we are unable to open a connection to our IBM-DB2 database. With the previous version R2021b, this is not a problem.
We are executing the following command in R2021b and R2022a
>> cs = 'dsn=DB2G;UID=SID#SFG;PWD=xxxxxxx;';
>> myConnection = actxserver('ADODB.Connection');
>> set(myConnection , 'ConnectionTimeout' ,0 )
>> set( myConnection , 'CursorLocation' , 'adUseClient')
>> invoke(myConnection , 'Open' , cs)
Resulting Error in R2022a
Error using COM.ADODB_Connection/Open
Invoke Error, Dispatch Exception:
Source: Microsoft OLE DB Provider for ODBC Drivers
Description: [Microsoft][ODBC-driver management] SQLAllocHandle of the driver on SQL_HANDLE_ENV failed
Successful output in R2021b
Properties: [1×1 Interface.00000504_0000_0010_8000_00AA006D2EA4]
ConnectionString: 'Provider=MSDASQL.1;'
CommandTimeout: 30
ConnectionTimeout: 0
Version: '10.0'
Errors: [1×1 Interface.00000501_0000_0010_8000_00AA006D2EA4]
DefaultDatabase: 'DB2G'
IsolationLevel: 'adXactCursorStability'
Attributes: 0
CursorLocation: 'adUseServer'
Mode: 'adModeUnknown'
Provider: 'MSDASQL.1'
State: 1
Both runs are on the same machine: Windows 10 Enterprise – Version 1909.
The same problem occurs on a second equivalent machine where we have installed R2022a.
We use an ODBC driver from IBM and not a Windows Db2 client. The Database (DB2) is on the mainframe not on windows.
The ODBC Driver is installed in 2021. The ODBC driver is : IBM DB2 ODBC DRIVER version 11.05.5010.1723
The connection also fails with the same error when using the Database Explorer App.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Database Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!