Skip to Content

connect to HANA Database via ODBC

Dec 22, 2017 at 09:16 AM


avatar image


I'm currently facing a problem when connecting to HANA database via ODBC. It works properly when I omit Parameter "DATABASENAME". But when I try to Connect using this Parameter, I always receive a "General error; 2 General error: database '<dbname>' does not exist. I've alread read about a similar problem, where incorrect port-no. seemed to cause the Problem. Well, I'm connecting to a multi-tenant DB and use 30015 as port-no. How can I retrieve proper port?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Bartosz Jarkowski Dec 22, 2017 at 09:31 AM

Hello ,

please check folowing blog post:

It clearly says how to retrieve the port numbers for multitenant databases.

10 |10000 characters needed characters left characters exceeded
Lars Breddemann
Dec 22, 2017 at 09:48 AM

connect to the SystemDB via port 3<instance no>13 plus the DATABASENAME. That will trigger the SAP HANA client to query the SystemDB for the actual port of the database.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Tried out "...SERVERNODE=srvsbodev10:30013;DATABASENAME=SBODEMODE"

Exception is "ERROR [08S01] [SAP AG][LIBODBCHDB32 DLL][HDBODBC32] Communication link failure;-10709 Connect failed (connect timeout expired)"

Manfred Rehm Dec 22, 2017 at 09:52 AM

Hello Bartosz,

Thank you very much for your soon Response!

I checked the blog post and run SQL-Statement on our Server. It returned

So, in my opinion port-no 30015 is appropriate for ODBC-Connectstring:


As this doesn't work, I also tried port-no 39013 (System tenant) which also failed.

I'm wondering, why using port 30015 works when ommiting DATABASENAME-Option. If port-no was not correct, it should work at all

hana1.png (8.6 kB)
Show 3 Share
10 |10000 characters needed characters left characters exceeded

You are confusing the database name with the server name here. Is this even a multi tenant db installation?

Could it be that you used to use MS SQL Server systems?


You're right, I'm used to SQL Server. I've tried out some various Connection strings and found that I used a catalog name instead of the database name. After changing that, I can connect to HANA-DB now. There's one problem with that: Unlike SQL Server I cannot determine an initial catalog. As none of the SQL-Statements used in our program references tables in way like "<catalog>.<table>", it would be very helpful to have an option to dertermine a Default catalog I need to use. Otherwise I'd have to change tons of queries.


The "initial catalog" in SAP HANA is the database users own schema.

You can set a different current schema when connecting to the database via the CURRENTSCHEMA parameter or, once connected, change the current schema via SET SCHEMA <SCHEMA NAME>.

There's no need to change your application code for that.