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 asked 23 Mar '15, 13:20 bradenpowers |
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. 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. answered 31 Mar '15, 11:10 Phil Mitchell 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.
(31 Mar '15, 14:16)
hnilsen
3
Based on you writing 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
(31 Mar '15, 14:32)
Phil Mitchell
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.
(31 Mar '15, 17:48)
hnilsen
|
You might have ran into the same problem as noted on another thread Running dbcapi examples on mac osx?. The -2004 is an error coming from the OSX loader and not native to SQL Anywhere so it does sound like a DYLD_LIBRARY_PATH related problem.
If this does not help, you might want to show the versions being used, mention your development environment, and supply some more context.
I will take a look
That really didn't help me. This is a node project that I am starting. I am running yosemite, node version is v0.10.26 and the version of sqlanywhere I am running is 1.0.3. I have the XCode developer tools installed. This is the code I am using:
var sqlanywhere = require('sqlanywhere');
var conn = sqlanywhere.createConnection();
var conn_params = { Host : 'My_IP:MY_port', UserId : 'user_id', Password: 'password', DatabaseName: db_name', ServerName: 'server_name' };
conn.connect(conn_params, function(err) { if( err ) { console.log( err ); return; } console.log( "Connected." );
});
So you can use DBPING or other utilities to connect to your database, as was suggested as test in that other FAQ?
I don't have that command. I did ping the database via ip successfully. I can also connect to it using the client RazorSQL and run queries against the database that I need to connect to.
So I found the sql anywhere tools and downloaded them. I ran DBPING and this is what I received:
Connection was dropped (may not be a SQL Anywhere server)
That is correct. This is a sybase server. Is there anything else I can do?
Hm, what exact SAP Sybase DBMS are you using - SQL Anywhere, ASE, Sybase IQ, ...?
If that is not SQL Anywhere then you may better ask in a different location, cf. the FAQ.
I'm experiencing exactly the same thing you are. Have you figured this out yet?
I don't yet believe the dbping error is related to the first issue. FWIW I can reproduce that error dbpinging, say, my IIS server as in dbping -c "host=localhost:80" and you should be able to get the same error dbpinging any open listener on any IP address that is not SQL Anywhere. That just means your HOST=<ip>:<port> is wrong and it is not the same thing as being unable to load a dynamic library (as in your first case).
If you make no progress with this you may want to open up a support incident . . .
Do at least identify the version and build of SQL Anywhere you are using.