<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Error: Code: -2004 Msg: Can't initialize DBCAPI in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814249#M4845092</link>
    <description>&lt;P&gt;I'm experiencing exactly the same thing you are. Have you figured this out yet?&lt;/P&gt;</description>
    <pubDate>Mon, 30 Mar 2015 21:49:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-03-30T21:49:41Z</dc:date>
    <item>
      <title>Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaq-p/13814240</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am new to using sqlanywhere and I am seeing this issue.  When I try to connect to sybase, I am seeing this error:&lt;/P&gt;
&lt;P&gt;[Error: Code: -2004 Msg: Can't initialize DBCAPI]&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2015 13:20:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaq-p/13814240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-23T13:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814242#M4845085</link>
      <description>&lt;P&gt;You might have ran into the same problem as noted on another thread &lt;A href="http://sqlanywhere-forum.sap.com/questions/9233/running-dbcapi-examples-on-mac-osx"&gt;Running dbcapi examples on mac osx?&lt;/A&gt;.  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.&lt;/P&gt;
&lt;P&gt;If this does not help, you might want to show the versions being used, mention your development environment, and supply some more context.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2015 13:58:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814242#M4845085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-23T13:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814243#M4845086</link>
      <description>&lt;P&gt;I will take a look&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2015 14:05:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814243#M4845086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-23T14:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814244#M4845087</link>
      <description>&lt;P&gt;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:&lt;/P&gt;
&lt;P&gt;var sqlanywhere = require('sqlanywhere');&lt;/P&gt;
&lt;P&gt;var conn = sqlanywhere.createConnection();&lt;/P&gt;
&lt;P&gt;var conn_params = {
  Host  : 'My_IP:MY_port',
  UserId  : 'user_id',
  Password: 'password',
  DatabaseName: db_name',
  ServerName: 'server_name'
};&lt;/P&gt;
&lt;P&gt;conn.connect(conn_params, function(err) {
         if( err ) {
        console.log( err );
        return;
    }
    console.log( "Connected." );&lt;/P&gt;
&lt;PRE class="codehilite"&gt;&lt;CODE&gt;conn.exec( "SELECT * from Table", function(err, result) {
    if ( err ) {
        console.log( err );
        return;
    }
    console.log( "Result: ", result );
});

conn.disconnect( function( err ) {
console.log( "Disconnected." );


&lt;P&gt;});&lt;/P&gt;
&lt;/CODE&gt;&lt;PRE class="codehilite"&gt;&lt;CODE&gt;&lt;CODE&gt;});&lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Mar 2015 14:25:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814244#M4845087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-23T14:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814245#M4845088</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;That really didn't help me.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you can use DBPING or other utilities to connect to your database, as was suggested as test in that other FAQ?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2015 15:35:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814245#M4845088</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2015-03-23T15:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814246#M4845089</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2015 16:04:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814246#M4845089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-23T16:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814247#M4845090</link>
      <description>&lt;P&gt;So I found the sql anywhere tools and downloaded them.  I ran DBPING and this is what I received:&lt;/P&gt;
&lt;P&gt;Connection was dropped (may not be a SQL Anywhere server)&lt;/P&gt;
&lt;P&gt;That is correct.  This is a sybase server.  Is there anything else I can do?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2015 17:29:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814247#M4845090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-23T17:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814248#M4845091</link>
      <description>&lt;P&gt;Hm, what exact SAP Sybase DBMS are you using - SQL Anywhere, ASE, Sybase IQ, ...?&lt;/P&gt;
&lt;P&gt;If that is not SQL Anywhere then you may better ask in a different location, cf. the &lt;A href="http://sqlanywhere-forum.sap.com/faq/"&gt;FAQ&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 04:56:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814248#M4845091</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2015-03-24T04:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814249#M4845092</link>
      <description>&lt;P&gt;I'm experiencing exactly the same thing you are. Have you figured this out yet?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2015 21:49:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814249#M4845092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-30T21:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814241#M4845084</link>
      <description>&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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. &lt;CODE&gt;libdblib16_r.dylib&lt;/CODE&gt;).  It requires that you have a SQL Anywhere client installation on the machine and that your &lt;CODE&gt;DYLD_LIBRARY_PATH&lt;/CODE&gt; references the lib64 directory within that installation.  e.g. if your installation is in &lt;CODE&gt;/opt/sqlanywhere16&lt;/CODE&gt;, set &lt;CODE&gt;DYLD_LIBRARY_PATH=/opt/sqlanywhere16/System/lib64&lt;/CODE&gt;.  The other thread that Nick referenced in his comment deals with how to make sure this is set within XCode.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 11:10:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814241#M4845084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-31T11:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814250#M4845093</link>
      <description>&lt;P&gt;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=&amp;lt;ip&amp;gt;:&amp;lt;port&amp;gt; is wrong and it is not the same thing as being unable to load a dynamic library (as in your first case).  &lt;/P&gt;
&lt;P&gt;If you make no progress with this you may want to open up a support incident . . .  &lt;/P&gt;
&lt;P&gt;Do at least identify the version and build of SQL Anywhere you are using.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 11:37:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814250#M4845093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-31T11:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814251#M4845094</link>
      <description>&lt;P&gt;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&lt;/P&gt;
&lt;P&gt;Don't really know how to solve that.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 14:16:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814251#M4845094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-31T14:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814252#M4845095</link>
      <description>&lt;P&gt;&lt;CODE&gt;dbping&lt;/CODE&gt; does not use DBCAPI.  &lt;CODE&gt;libdblib16_r.dylib&lt;/CODE&gt; needs to be accessible through your &lt;CODE&gt;DYLD_LIBRARY_PATH&lt;/CODE&gt;.  You need to set up your environment before you can run.&lt;/P&gt;
&lt;P&gt;Based on you writing &lt;CODE&gt;libdblib16_r.so&lt;/CODE&gt; 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 &lt;CODE&gt;LD_LIBRARY_PATH&lt;/CODE&gt;.  If you are getting that error message on Mac, then that is a problem.&lt;/P&gt;
&lt;P&gt;For help running the command-line utilities on UNIX and Mac OS X, please refer to the SQL Anywhere documentation:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://dcx.sap.com/index.html#sa160/en/dbadmin/da-envvar-b-6065834.html"&gt;http://dcx.sap.com/index.html#sa160/en/dbadmin/da-envvar-b-6065834.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 14:32:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814252#M4845095</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-31T14:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Code: -2004 Msg: Can't initialize DBCAPI</title>
      <link>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814253#M4845096</link>
      <description>&lt;P&gt;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 &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 17:48:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-code-2004-msg-can-t-initialize-dbcapi/qaa-p/13814253#M4845096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-03-31T17:48:54Z</dc:date>
    </item>
  </channel>
</rss>

