最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

vuejs3 - How to make a Vue.js web app connect to a MS Access database stored under the root folder? Can node-adodb be helpful? -

programmeradmin5浏览0评论

I create a Vue.js 3 web app. I would like to power this web app using a MS Access database file, says books.accdb.

I npm installed the node-adodb module, hoping this can help me connect to the books.accdb

> npm install node-adobd
> npm install buffer

My App.vue file:

<template>
  <router-view />
</template>

<script setup>

import ADODB from 'node-adodb';
console.log(ADODB)

</script>

The error message on the console shows:

Uncaught ReferenceError: Buffer is not defined
js    spawn.js:22 
__require2 chunk-7FP5O474.js:10
js    proxy.js:10 
__require2  chunk-7FP5O474.js:10
 js   index.js:10 
__require2 chunk-7FP5O474.js:10
<anonymous> node-adodb.js:725

Any ideas that I can make this work? Thanks.

I may not know how to import node-adodb correctly to a Vue app. and not sure whether connect to a Access DB file will work or not. Please help.

I create a Vue.js 3 web app. I would like to power this web app using a MS Access database file, says books.accdb.

I npm installed the node-adodb module, hoping this can help me connect to the books.accdb

> npm install node-adobd
> npm install buffer

My App.vue file:

<template>
  <router-view />
</template>

<script setup>

import ADODB from 'node-adodb';
console.log(ADODB)

</script>

The error message on the console shows:

Uncaught ReferenceError: Buffer is not defined
js    spawn.js:22 
__require2 chunk-7FP5O474.js:10
js    proxy.js:10 
__require2  chunk-7FP5O474.js:10
 js   index.js:10 
__require2 chunk-7FP5O474.js:10
<anonymous> node-adodb.js:725

Any ideas that I can make this work? Thanks.

I may not know how to import node-adodb correctly to a Vue app. and not sure whether connect to a Access DB file will work or not. Please help.

Share Improve this question asked 7 hours ago Sinji YangSinji Yang 1293 silver badges3 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Bro to deal with databases you need to go server-side using node.js. node-adobedb isn't meant to be run in a browser. It relies on Node-specific globals (like Buffer) and Windows-only APIs (ActiveX objects) that aren’t available in client-side JavaScript. In other words, you can’t bundle it directly into a Vue.js 3 app for use in the browser. When you go server-side, your backend can use node-adodb to connect to books.accdb and then expose a REST API that your Vue app can call.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论