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 badges1 Answer
Reset to default 1Bro 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.