执行select * from tablename
之类的选择查询时遇到错误
code:-2146825287
message:"Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."
这是我正在使用的代码,
const connection = ADODB.open(
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
appRoot.path +
"\\test.mdb"
);
const query = "SELECT * FROM tablename";
connection
.query(query)
.then(data => {
if (data) {
console.log(JSON.stringify(data, null, 2));
}
callback();
})
.catch(error => {
console.error(error);
callback(null, error);
});
答案 0 :(得分:0)
当我检查表中有太多字段时,我找到了解决方案。这样会引发错误。您只需在查询中选择所需的唯一列即可。
例如
select column1, column2,etc. from tablename