sqlanywhere / node-sqlanywhere

SAP SQL Anywhere Database Client for Node
Apache License 2.0
38 stars 36 forks source link

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

Closed steveBull-b closed 6 years ago

steveBull-b commented 7 years ago

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 .

elcheshoro commented 6 years ago

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

gperrow-SAP commented 6 years ago

Take a look at this answer on sqlanywhere-forum.sap.com: http://sqlanywhere-forum.sap.com/questions/24377/error-code-2004-msg-cant-initialize-dbcapi

josephdgb1996 commented 6 years ago

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

redevill commented 2 years ago

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

DanCummins-SAP commented 2 years ago

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

mandres commented 1 year ago

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!