Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
OscarM
Partner - Contributor
Partner - Contributor

Connection string ODBC for SAP Hana?

Hi everyone.

We got a new connection to SAP HANA S/4 and I need help with the connection string for this. When i try doing it manually via ODBC through the wizard, after set user and pass the wizard ask me host and port. After entering this info, the connection works perfectly, but I need to have the complete sentence on a variable. I couldn't find a way to write correctly the string adding this two parameters (host and port). The string made with the wizard its the next one:

ODBC CONNECT TO ['Server Name'] (XUserId is 'User', XPassword is 'Pass');

How can I force the host and port on the previous string?

Labels (2)
1 Reply
diegozecchini
Specialist
Specialist

Hi!

To manually include the host and port in the ODBC connection string for SAP HANA, you can modify the connection string format by adding these parameters explicitly.

For SAP HANA, a typical ODBC connection string looks like this:

Driver={HDBODBC};ServerNODE=[HOST]:[PORT];UID=[User];PWD=[Password];
Here's how you can structure it based on your description:

Driver: This would be the SAP HANA ODBC driver name, typically HDBODBC.
ServerNODE: This will include both the hostname (or IP address) and the port number.
UID: The user ID.
PWD: The password.
For example, assuming your server is on myserver.com, using port 30015, the string would look like:


ODBC CONNECT TO "Driver={HDBODBC};ServerNODE=myserver.com:30015;UID=User;PWD=Pass";
In your case, you would replace myserver.com, 30015, User, and Pass with the actual host, port, username, and password you're using.

You can integrate this into your script or application by assigning the connection string to a variable. Make sure to include all necessary details for authentication and connection to SAP HANA S/4.

regards,

Diego