cancel
Showing results for 
Search instead for 
Did you mean: 

sy-subrc=4 when connect to external SQL DB

Former Member
0 Kudos

Hi experts,

I want to connect to external SQL database from SAP with HANA database. And i done the config by tcode: DBCO like below:

And below is the test connection program

CONSTANTS:cn_sql_conn_name TYPE dbcon-con_name

                                        VALUE 'ZHR_PT_TX_DB_CONNECTION'.

EXEC SQL.

   CONNECT TO :cn_sql_conn_name

ENDEXEC.

IF sy-subrc <> 0.


ENDIF.


And sy-subrc = 4 when a run this code. Then I searched on the internet and found it maybe caused less of dbmssslib.<ext> file.

But i use tcode: AL11 to check the file existed in system,

and still cannot connect to the external SQL database.


But when i did the same thing in SAP IDS system based on non-HANA dabase, it connected to SQL db successfully.


Did anybody met this issue before??



Accepted Solutions (1)

Accepted Solutions (1)

luisdarui
Advisor
Advisor
0 Kudos

Hello Mo,

The aspect that you should take in consideration when remote connecting to a SQL Server database is not the database where your system runs, but the Operating System.

SQL Server is a Microsoft product, and Microsoft released so far a client software only for Windows and Linux. All other operating systems doesn't have a supported client to connect to SQL Server, and therefore we at SAP doesn't have a DBSL for other operating systems than Windows and Linux.

  1. Have you installed the Linux client as described in SAP Note 1644499 ? Are you able to remote connect by using the SQLCMD ?
  2. If yes, are you following SAP KBA 1601608 How to access an external Microsoft SQL Server database?
  3. This wiki page in SAP on SQL Server SCN Wiki provide some troubleshooting aspects: http://wiki.scn.sap.com/wiki/x/5gkLGg, please go through it in case you haven't gone.

Best Regards,

Luis Darui

Former Member
0 Kudos

Hi Luis,

Very appreciate for your kindly reply. I tried to run the test connection program - ADBC_TEST_CONNECTION and checked the trace file that saying as below:

In SAP note 1082356 said we would install the native drivers for SQL server. So maybe I need our basis team's help to do this by following the note suggesting and your comment then try again.

luisdarui
Advisor
Advisor
0 Kudos

Hi Mo,

This note is in this case is not applicable. The information is misleading about the ODBC driver right now (we're in process to update this message in case of Linux).

But the next errors are what we're looking for. Make sure the driver is installed as per SAP Note 1644499 and you can remote connect through SQLCMD to the database server while logged as <sid>adm. The driver must work for this user, since the system runs under <sid>adm.

Once this is working and you have the minimum DBSL applied you should be able to remote connect to SQL Server.

Generally this wiki provide this guidance on how to troubleshoot it:

http://wiki.scn.sap.com/wiki/x/5gkLGg

Best Regards,

Luis Darui

Answers (0)