Código:
var express = require('express'); var router = express.Router(); var fs = require("fs"); var contents = fs.readFileSync("pruebas.json"); var ADODB = require('node-adodb'); ADODB.debug = true; // Connect to the MS Access DB var connection = ADODB.open('Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\Omar\\Documents\\1.accdb;Persist Security Info=False;'); // Query the DB router.get('/',function (peticion,respuesta){ console.log("estamos en el get"); // Query the DB connection .query('SELECT MSysObjects.Name FROM MsysObjects WHERE (Left$([Name],1)<>"~") AND (Left$([Name],4) <> "Msys") AND (MSysObjects.Type)=1 ORDER BY MSysObjects.Name') .on('done', function (data){ //console.log('Result:'.green, data); for (var x = 0; x < data.records.length;x ++){ console.log(data.records[x]); } console.log(data.records); respuesta.render('index.jade', {peliculas: data.records}); }); }); module.exports = router;
PD: la cosa es que la sentencia SÍ me funciona dentro de la sección de SQL de access