Open Database Connectivity (ODBC) provides an API for accessing databases. Database vendors provide ODBC drivers for their database products. An application written to the ODBC standard can be ported to other databases that also provide an ODBC interface.
Step 1Configure a data source using Microsoft Windows ODBC Data Source Administrator
โ
The ODBC Data Source Administrator lists the installed ODBC drivers and the configured data sources.
Open the administrator by entering ODBC after clicking on the Microsoft Windows start icon.
Ensure that you choose the 64-bit version if you have the 64-bit version of the SAP HANA client installed.
start ODBC Administrator
Click the Drivers tab and view the installed drivers.
odbc admin drivers
The SAP HANA ODBC driver (HDBODBC) is visible.
Click the User DSN tab to view the data sources.
Click Add to create a new data source to connect to a SAP HANA database.
Add ODBC user data source
Select HDBODBC and click Finish.
New data source
Example data source configuration for SAP HANA Cloud.
For the host, paste the SQL Endpoint from your instance. For more details, review Choose an SAP HANA Database.
ODBC HANA Cloud
Example data source configuration for SAP HANA, express edition.
ODBC HXE
To connect to SAP HANA, express edition, Multitenant should be checked and the Validate TLS/SSL certificate option can be unchecked. For more information on this topic, see How to Configure TLS/SSL in SAP HANA 2.0.
Click Test connection.
Test Succeeded
The user name USER1 and password Password1 can be entered when prompted for credentials.
Press OK to save the data source.
Saved values can also be viewed using the Microsoft Windows registry editor under the key Computer\HKEY_CURRENT_USER\Software\ODBC\ODBC.INI.
Step 2Configure a data source on Linux or Mac with unixODBC
+
The following instructions demonstrate how unixODBC can be used to configure and test a data source on Linux or Mac.
On SUSE Linux, the YaST installer can be used to install unixODBC.
YaST installer
For more details on how to accomplish this, please follow the second step of this tutorial.
On a Mac, unixODBC can be installed using Homebrew.
Shell
brew install unixodbc
The following commands can be used to confirm that unixODBC is installed, determine the location of the .odbc.ini file (if it exists), and to confirm the location of the SAP HANA client install that contains the ODBC driver.
Shell
odbcinst -j
which hdbsql
odbcinst
Navigate to a directory, similar to the first one that is highlighted in the screenshot above.
Shell
cd$HOME
Edit the .odbc.ini file (or create it if it does not exist) to add one or more data sources. Be sure to configure the values of servernode and driver so that they conform with your setup.
The driver’s file extension is dylib instead of so on a Mac.
unixODBC provides a basic SQL query tool called isql that can be used to validate a data source.
Shell
isql -v HANA_Cloud User1 Password1
Once you see a message that indicates a connection has been made, enter the following statement to verify this.
Shell
SELECT * FROM HOTELS.CUSTOMER
isql
Step 3Use a SAP HANA data source from another program
+
An application that supports ODBC can now make use of the created data source. One example on Windows is Microsoft Excel.
Microsoft Excel can be 32 or 64 bit. This can be seen under File | Account | About Excel.
Excel 64 bit
The SAP HANA client install can also be 32 or 64 bit. To connect, the versions of SAP HANA client and Microsoft Excel must match. If needed, the 32-bit installer for SAP HANA client is available from the SAP Software Centre site and can be installed into a separate directory such as C:\SAP\hdbclient32.
The following steps demonstrate how to use Microsoft Excel to query data in SAP HANA using the ODBC connector.
On Microsoft Windows, open Microsoft Excel.
In the Data tab, go to Get Data | From Other Sources | From ODBC.
Excel ODBC
Select the previously created data source that contains the connection information to an SAP HANA database.
Excel DSN
Enter the credentials.
Credential Screen
Select a schema and table, then press Load.
Browse Schema
The selected data is now imported into a Microsoft Excel spreadsheet.
Excel Show Data
One further option for some tools is to provide the connection details directly to an ODBC enabled application as shown below.
Excel ODBC Connection String
For further information on programming an application to use the ODBC client driver, see ODBC Application Programming.
Step 4Knowledge check
+
Congratulations! You have configured an ODBC data source to contain connection information for a SAP HANA database and used that data source from Microsoft Excel.
Share feedback on this tutorial or join the conversation in SAP Community.
Submit detailed feedbackDiscuss in Community
Steps
Step 1 of 4
1. Configure a data source using Microsoft Windows ODBC Data Source Administrator2. Configure a data source on Linux or Mac with unixODBC3. Use a SAP HANA data source from another program4. Knowledge check
Joule
AI Notice
Joule is an AI assistant. Generative AI may produce inaccurate, incomplete, or biased information. Always verify important details before acting on them.
Conversations are sent to SAP-hosted large language models for processing. Do not include personal data, credentials, or confidential information in your messages.
Joule's responses are based on the SAP tutorial catalog and may not reflect the latest product changes. For authoritative guidance, consult the linked tutorials and official SAP documentation.