连接错误到Firebird数据库

我已经附上我的代码和错误消息在下面。 你能帮我吗,我找不到错误的原因。 谢谢,

//我的代码

// Node-Firebird var Firebird = require('node-firebird'); // Options var options = {}; //options.host = '127.0.0.1'; //options.port = 3050; options.database = 'mydb.FDB'; options.user = 'SYSDBA'; options.password = 'masterkey'; // Query Firebird.attach(options, function(err, db) { if (err) throw err; // db = DATABASE db.query('SOME QUERY', function(err, result) { // IMPORTANT: close the connection db.detach(); }); }); 

// 错误信息

/Users/bla/myfile.js:14抛出错误; ^错误:文件“/Users/bla/mydb.FDB”的“打开”操作期间发生I / O错误,尝试在doCallback中打开文件时出错(/Users/bla/node_modules/node-firebird/lib/index.js :1233:18)at /Users/bla/node_modules/node-firebird/lib/index.js:2897:21 at /Users/bla/node_modules/node-firebird/lib/messages.js:151:25 at search( /Users/bla/node_modules/node-firebird/lib/messages.js:117:13)在/Users/bla/node_modules/node-firebird/lib/messages.js:54:21 FSReqWrap.wrapper as oncomplete

注意:实际上,我可以使用基于c ++的驱动程序连接相同的数据库:

 var fb = require("firebird"); var con = fb.createConnection(); con.connectSync('mydb.FDB', 'SYSDBA', 'masterkey', ''); var rs = con.querySync('SOME QUERY'); 

而当我试图通过Flamerobin进行连接时,它也可以很好地工作。 这真是奇怪的错误,我想。 还有其他build议吗?

我不知道node-firebird驱动程序,但是考虑到这种行为,可以在本地连接(使用客户端库作为服务器),而另一个则通过服务器连接。 这可能会导致以下问题:

  1. 您正在指定相对path(除非将mydb.FDB定义为别名)的不同path分辨率,可能文件/Users/bla/mydb.FDB不存在
  2. 访问权限不足,错误中的path/Users/bla/mydb.FDB表明它是用户文件夹中的数据库,这意味着Firebird服务器进程(通常在用户firebird下运行)无法访问该数据库。