sqlanywhere / node-sqlanywhere

SAP SQL Anywhere Database Client for Node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

steveBull-b opened this issue · comments

I am using node js (sails) and SQL Anywhere 16 for development. After I install node Sql Anywhere driver and follow all step to set up SQL Anywhere environment. (I also install the client software in my mac).it always return Error: Code: -2004 Msg: Can't initialize DBCAPI. However, i can run the dbping command for ping the other server database and return successful .

@steveBull-b did you find a solution to this? Getting the same error.

@steveBull-b did you find a solution ? I have the same issue

Me too - only Sql Anywhere 17 now, node driver V1.0.27. I can connect on the database server... but not remote connect with the driver from Nodejs

Hi all,

You need the libraries to be in the LibPath but also the SQLANY_API_DLL should point to the full path of the "DBCAPI" library itself. This is true of the Node sqlanywhere driver and the python sqlanydb driver.

Example for macOS follows.

The "DBCAPI" library on macOS is libdbcapi_r.dylib.

Set SQLANY_API_DLL to point to dbcapi library:
export SQLANY_API_DLL=/Applications/SQLAnywhere17/System/lib64/libdbcapi_r.dylib

Add dependent libraries to library path:
source /Applications/SQLAnywhere17/System/bin64/sa_config.sh

If you need the Client software, it can be found here:
https://wiki.scn.sap.com/wiki/plugins/servlet/mobile?contentId=448478814#content/view/448478814

HTH,
Dan

Hi all,

You need the libraries to be in the LibPath but also the SQLANY_API_DLL should point to the full path of the "DBCAPI" library itself. This is true of the Node sqlanywhere driver and the python sqlanydb driver.

Example for macOS follows.

The "DBCAPI" library on macOS is libdbcapi_r.dylib.

Set SQLANY_API_DLL to point to dbcapi library: export SQLANY_API_DLL=/Applications/SQLAnywhere17/System/lib64/libdbcapi_r.dylib

Add dependent libraries to library path: source /Applications/SQLAnywhere17/System/bin64/sa_config.sh

If you need the Client software, it can be found here: https://wiki.scn.sap.com/wiki/plugins/servlet/mobile?contentId=448478814#content/view/448478814

HTH, Dan

Thanks a lot!