-
-
Save theduderog/d24bf6820d9a034f1763 to your computer and use it in GitHub Desktop.
ODBC connection does not close
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var odbc = require('odbc'); | |
var db = new odbc.Database(); | |
db.open("DSN=Test;UID=foo;PWD=XXX", function(err) | |
{ | |
if (err) { | |
console.error("error: ", err.message); | |
db.close(); | |
} | |
else { | |
console.log("Connected"); | |
//Comment this part out and db.close() will invoke the callback | |
//Otherwise, it does not | |
db.describe({database: 'RETAIL', schema: 'RETAIL', table: 'PURCHASES'}, function (err, result) { | |
if (err) { | |
console.error(err); | |
} | |
else { | |
console.log(result); | |
console.log("Closing connection"); | |
db.close(function () { | |
console.log("Closed"); | |
}); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment