sybase - Node.js and node-sqlanywhere - No Connection Available -
i have been trying use node-sqlanywhere query sybase database.
however, cannot seem able connect database.
var sqlanywhere = require('sqlanywhere'); var sqlanywhere_conn = sqlanywhere.createconnection(); var sqlanywhere_conn_params = { databasefile: 'c:\users\support\dropbox\database.db', autostart: 'yes', userid: 'user_id', password: 'password' }; sqlanywhere_conn.connect(sqlanywhere_conn_params, function(){ sqlanywhere_conn.prepare('select * some_table some_column = ?', function (err, stmt){ if (err) throw err; // statement }); });
whether trying connect database using server attribute or databasefile attribute, error code -2005 no connection available.
that being said, able connect database using interactive sql either specifying server or database file.
so.. must missing here , can't figure out !
thanks !!
try doubling backslash characters, databasefile: 'c:\\users\\support\\dropbox\\database.db'
.
fyi can ask sql anywhere-specific questions on http://sqlanywhere-forum.sap.com.
full disclosure: work sap in sql anywhere engineering. responsible both node.js driver , sqlanywhere-forum.sap.com site.
Comments
Post a Comment