简体   繁体   English

使用node.js设置Microsoft Access数据库连接

[英]Setting up a microsoft access database connection with node.js

Hy guys, 大家好

I recently started looking into node.js, and I decided to rewrite all the php code to javascript code. 我最近开始研究node.js,并决定将所有php代码重写为javascript代码。 That all went well, but now I'm trying to set up a database connection to a microsoft access database. 一切顺利,但是现在我正尝试建立与Microsoft Access数据库的数据库连接。 I tried doing something like this: 我试图做这样的事情:

var dbname = "/databases/users.accdb"; var db = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=" + dbname + ";Uid=Admin;Pwd=;");

But that doesn't seem to work, since it gives me Uncaught ReferenceError: PDO is not defined error. 但这似乎不起作用,因为它给了我Uncaught ReferenceError: PDO is not defined错误。

How would i do this properly? 我该怎么做呢?

Sincerely, Zeno 真诚的,芝诺

EDIT: I have set the environment PYTHON variable, downloaded microsoft visual studio 2012, and when I install the odbc module, 300+ error lines are produced. 编辑:我已经设置了环境PYTHON变量,下载了Microsoft Visual Studio 2012,当我安装odbc模块时,会产生300多个错误行。 too much to list here obviously, i can't even see the top of the error log in the console... Anyone has an idea what's going on? 显然这里太多了,我什至在控制台中都看不到错误日志的顶部……任何人都知道发生了什么事?

NPM中选择一个数据库库,进行安装 ,然后按照其文档进行操作,而不是尝试在JavaScript程序中间使用PHP代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM