cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Code: -2004 Msg: Can't initialize DBCAPI

Former Member
5,263

Hello,

I am new to using sqlanywhere and I am seeing this issue. When I try to connect to sybase, I am seeing this error:

[Error: Code: -2004 Msg: Can't initialize DBCAPI]

I can connect with other clients like RazorSQL. I am running this code on a mac and our servers for prod will be Unix. I am just trying to connect at this point. I searched for information on this and I cannot find any.

Thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

Based on your discussion with Volker and Nick, it appears as though you are not using a SQL Anywhere server. The sqlanywhere node.js driver is specific to the SQL Anywhere server, so if your backend is not SQL Anywhere, then you should look for another driver.

Additionally, the node.js driver uses the DBCAPI library to communicate. The DBCAPI library needs to be able to load the SQL Anywhere client library (e.g. libdblib16_r.dylib). It requires that you have a SQL Anywhere client installation on the machine and that your DYLD_LIBRARY_PATH references the lib64 directory within that installation. e.g. if your installation is in /opt/sqlanywhere16, set DYLD_LIBRARY_PATH=/opt/sqlanywhere16/System/lib64. The other thread that Nick referenced in his comment deals with how to make sure this is set within XCode.

If you believe you have met all of the above requirements, then please let us know the version of the SQL Anywhere server to which you are connecting, and the version of the SQL Anywhere client libraries you have installed. You have already mentioned the version of node.js driver.

Former Member
0 Kudos

I think the problem lies with the DBCAPI library. I'm trying to start dbping, and get this result: ./dbping: error while loading shared libraries: libdblib16_r.so: cannot open shared object file: No such file or directory

Don't really know how to solve that.

Former Member

dbping does not use DBCAPI. libdblib16_r.dylib needs to be accessible through your DYLD_LIBRARY_PATH. You need to set up your environment before you can run.

Based on you writing libdblib16_r.so it appears that you are on another UNIX platform (perhaps Linux; the original question was on Mac). The name of the environment variable differs based on the platform. For example, on Linux, it will be LD_LIBRARY_PATH. If you are getting that error message on Mac, then that is a problem.

For help running the command-line utilities on UNIX and Mac OS X, please refer to the SQL Anywhere documentation:

http://dcx.sap.com/index.html#sa160/en/dbadmin/da-envvar-b-6065834.html

Former Member
0 Kudos

LD_LIBRARY_PATH was corrent, thanks - I now get a more reasonable error: [Error: Code: -100 Msg: Database server not found] - so I just need to figure out why I'm getting this instead 🙂 Thanks for your help.