node-odbc
node-odbc copied to clipboard
Error '[node-odbc] Error in ODBCResult::MoreResultsSync',
I have set up unixODBC, MDBTools and node-odbc. Now I want to query something from an mdb file doing this:
odbc.open('DRIVER=MDBTools;DBQ=<filename>;', function (err) {
if (err) return console.log(err);
odbc.query("SELECT * FROM testdata", function (err, rows, moreResultSets) {
if (err) console.log(err);
console.log(rows);
odbc.close(function () {
console.log('done');
});
});
});
But all I get is an endless loop with this error:
{ [Error: [unixODBC][Driver Manager]Driver does not support this function]
errors:
[ { message: '[unixODBC][Driver Manager]Driver does not support this function',
state: 'IM001' } ],
error: '[node-odbc] Error in ODBCResult::MoreResultsSync',
message: '[unixODBC][Driver Manager]Driver does not support this function',
state: 'IM001' }
[]
Wow. It seems like that particular driver doesn't support checking if there are more result sets.
You might have to go off the grid and do something like:
odbc.queryResult("select * from testdata", function (err, result) {
//if (err) ... do stuff
result.fetchAll(function (err, rows) {
//if (err) ... do stuff
odbc.close(function () {
console.log('done');
});
});
});
This is unfortunately undocumented territory.