nuintun / node-adodb

A node.js javascript client implementing the ADODB protocol on windows.
https://nuintun.github.io/node-adodb
MIT License
185 stars 51 forks source link

Get more than 10 records #107

Closed tecnicosya closed 5 years ago

tecnicosya commented 5 years ago

I have a query that get all items from a table, no really big. Just 280 records, with 2 fields, id and description. On Access work fine and get all records, but then I execute on Node just get 10 elements for each iteration.

My query: SELECT TIPO.ID, TIPO.DES FROM TIPO ORDER BY TIPO.ID;

I try to count all items to know the size of the table and start to get 10 by 10, but the answer is wrong, just say 10 items. SELECT COUNT('id') FROM TIPO;

Get the right answer on MS Access, but on Node I get strange answer: [ { "Expr1000": 10 } ]

I try to get the top 500 elementens, but again I get 10 elements.

tecnicosya commented 5 years ago

I feel I found the solution, just dont understand. 'use strict';

const path = require('path'); const mdbPath = path.resolve('DB_Path'); const connStr = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DB Path';

const ADODB = require('./index');

const pool = ADODB.createPool(connStr);

pool.query('SELECT * FROM usuario;', (err, data) => { if (err) { console.error(err.message); } else { console.log(data); }

pool.end();

});