在带有 Node.js 的 Linux 服务器上使用 Microsoft 访问 DB .accdb [英] Using a Microsoft access DB .accdb on a linux server with Node.js

查看:61
本文介绍了在带有 Node.js 的 Linux 服务器上使用 Microsoft 访问 DB .accdb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我在 Windows 上轻松完成了这项工作,这并不奇怪.但我更关心在生产 linux 服务器上运行它.

So, I got this working on windows easy, and that is not surprising. But I am more concerned about running this on a production linux server.

有没有办法让 Access Runtime 2013 在基于 linux 的系统上工作,而不会抛出一些奇怪的方法.如果没有,那么我将不得不重新考虑我的计划.

Is there a way to get the Access Runtime 2013 to work on a linux based system without throwing some weird way of doing it. If not, then I am going to have to rethink my plans.

就像代码库一样,这就是我正在做的:

Just as a code base this is what I am doing:

const ADODB = require('node-adodb');
ADODB.debug = true;
//Bring in LUT Database
const LUTDB = ADODB.open(
  'Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database1.accdb;Persist Security Info=False'
);
LUTDB.query('SELECT * FROM Table1')
  .then(data => {
    console.log(data);
  })
  .catch(err => {
    console.log(err);
  });

推荐答案

没有.

Access Runtime(以及数据库引擎和完整应用程序)仅与 Windows 兼容,除非 Wine 东西/其他不适合生产的技巧,否则它显然无法工作.

The Access Runtime (as well as the database engine and full application) is only compatible with Windows, and barring Wine stuff/other trickery that's not production-worthy, it plain won't work.

有适用于 Access 的第三方 ODBC/JDBC 驱动程序,可以在 Linux 上运行,但没有来自 Microsoft 的官方驱动程序.

There are third-party ODBC/JDBC drivers for Access out there that do work on Linux, but nothing official from Microsoft.

我的建议是:要么不要在 Linux 上使用 Access(最好),要么尝试使用 JDBC 包装器(非附属)的 UCanAccess.请注意,accdb 文件格式已更改多次,因此如果您不使用积极维护的产品,您可能会遇到问题/不兼容.

My recommendation would be: either don't use Access on Linux (best), or try UCanAccess with a JDBC wrapper (not affiliated). Note that the accdb file format has changed a number of times, so you can expect trouble/incompatibilities if you don't use an actively maintained product.

这篇关于在带有 Node.js 的 Linux 服务器上使用 Microsoft 访问 DB .accdb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆