Skip to content Skip to sidebar Skip to footer

How To Access An Access Database Using Javascript?

I have to display marks of my students through my site. The database is created using Microsoft Access. How can I display the marks of each student in a table, as they enter the re

Solution 1:

I know this is an old question, but I happened to come across this project, AccessDB, at the same time as this question so I figured I'd post it. Note that it says it is for use with Internet Explorer. I'm guessing they are using a Microsoft only feature to access the file, but I really haven't looked into it.

From their website:

ACCESSdb is a JavaScript library used to dynamically connect to and query locally available Microsoft Access database files within Internet Explorer. All you need is an .mdb file; Access does not even need to be installed!

http://accessdb.sourceforge.net/

Solution 2:

JavaScript can't directly access the database. You'll need to have some server-side component that takes requests (probably via HTTP), parses them and returns the requested data.

Then the JavaScript could access that component to fetch the data (hm ... smells like AJAX).

Solution 3:

Why do you want to use Javascript? It runs in the browser of the site's visitors, and even if there were a way to have it directly access a database (which there isn't), it would be a horrible security risk, since it would have to contain the DB password, so that each visitor of the site could get full access to the DB.

What you need is something that runs on the server and accesses the DB to deliver different pages to the visitor depending on data entered in an HTML form. Typical languages used for this are PHP, Perl, Ruby or ASP.

Also note that MS Access is a very poor choice as a DB backend to a web app since it does not support concurrent access from different users.

All in all it looks like you need more direct help than this site can provide; try finding a web app specialist in your area.

Solution 4:

If you're looking for client-side database access, then what everyone else said.

If you're just looking for a way to access a database (NOT in a browser), and Javascript is the language you're most comfortable with, try JSDB. (It's a Javascript shell that has bindings for databases via ODBC, SQLite, and flat files) I've used it a lot and it's my preferred scripting shell.

Solution 5:

This question has been asked a long time ago, recently i found something helpful for future visitors. You can actually access your database via this javaScript library called mysqljs,which can be downloaded from http://www.mysqljs.com

Code synax:

MySql.Execute(
    "mysql.yourhost.com", 
    "username", 
    "password", 
    "database", 
    "select * from Users", 
    function (data) {
        console.log(data)
});

Note: There is no security by default in this you are to code your own security

Post a Comment for "How To Access An Access Database Using Javascript?"