Introduction #
How to Connect to SAP HANA Database Using an OLEDB-ODBC Bridge #
Learn how to connect to SAP HANA Database using an OLEDB-ODBC bridge. This article provides guidance for using the Call Stored Procedure (OLEDB) tool to connect to a SAP Business One HANA database.
Problem #
The SAP HANA database has an 32-bit ODBC driver (HDBODBC32). However, if your tasks make use of the Call Stored Procedure (OLEDB) tool, you are unable to make use of the stored procedures.
You’ve tried to create a OLEDB connection to the HANA ODBC data source but this has resulted in the BPA Platform client being unresponsive.
Solution #
To create an OLEDB connection to an ODBC data source, you must use Microsoft OLEDB Provider for ODBC Drivers and create a connection to any ODBC data source first before changing it to the SAP HANA data source. In the procedure below, we are connecting to a Microsoft SQL Server data source:
Creating an ODBC Data Source #
Create an ODBC data source to a working database (not HANA):
- Launch the Windows ODBC Data Source Administrator (32-bit).
- In the System DSN tab, Add a new ODBC data source.
- Select the relevant driver and click Finish — for this example, use SQL Server.
- Name this connection and select the Server to connect to.
- Click Next and provide the server details (username, password, and so on) as required.
- Save the connection.
Creating a BPA Platform OLEDB Connection #
Now create a global OLEDB connection to a valid database using the ODBC data source. You can create the global connection in either the Database Query (OLEDB) or Call Stored Procedure (OLEDB) tool; the global OLEDB configuration is shared between the two:
- Log into the BPA Platform client.
- Go to Manage < Tools < Data Connectors < Call Stored Procedure (OLEDB).
- Add a new connection using the Microsoft OLEDB Provider for ODBC Drivers driver.
- Go to the Machine Data Source tab and select the System DSN created previously:
- Clear the selection for Use Trusted Connection and enter the required credentials for the database.
- Click Options and choose the relevant Database.
- Click OK.
Connecting to the SAP HANA Data Source #
Finally, we change the OLEDB connection to point to the HANA database:
- Still in the OLEDB global configuration window, highlight the new connection created previously and click Properties.
- Click Reconfigure.
- Change Machine Data Source to the HANA ODBC data source; click OK.
- Change the Login ID (username), Password, Database, and Workstation to the relevant SAP HANA database.
- Save your changes.
You should now be able to access the SAP HANA database over OLEDB.