How to access an Access database using JavaScript?

I need to display the labels of my students through my site. The database is created using Microsoft Access . How can I display the labels of each student in the table when they enter the registration number?

+3
source share
9 answers

Why do you want to use Javascript? It works in the browser of site visitors, and even if it had direct access to the database (which is not), this would be a terrible security risk, since it had to have a database password, so that every site visitor could get full access to the database.

You need something that runs on the server and accesses the database to deliver different pages to the visitor, depending on the data entered in the 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 database backend for a web application, since it does not support simultaneous access from different users.

In general, it seems you need more direct help than this site can provide; try to find a web application specialist in your area.

+6
source

JavaScript cannot directly access the database. You will need a server component that accepts requests (possibly via HTTP), parses them, and returns the requested data.

Then, JavaScript could access this component to retrieve the data (hm ... smells like AJAX).

+3
source

I know this is an old question, but I happened to meet this project, AccessDB, at the same time as this question, so I decided that I would publish it. Please note that it says that it is intended for use with Internet Explorer. I assume that they only use the Microsoft function to access the file, but I really have not studied it.

On its website:

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

http://accessdb.sourceforge.net/

+2
source

I have not used M $ Access for a very long time, but I think they have pretty good ways to export data to HTML format. This will be static HTML, but that may be enough for what you want to do. Definitely easier than writing a database backend ...

+1
source

You think from the client side, while you should think from the server side.

You need a server-side script that will request Access and create HTML for it, depending on the value of the registration number provided in the form.

The scripting language is up to you. Given that you use Access, I believe that one of the Microsoft language families will be the best, and that your institution will already have a web server (presumably IIS) to host your site.

First of all:

  • What server software is running in your facility? This determines the best programming language to use.
  • What is your budget? If it is close to zero, you are looking at free IDEs. It might be better to develop in Eclipse and deploy to Tomcat, regardless of the server OS.
  • What languages โ€‹โ€‹do you speak?
  • Get a website programming book using your technology of choice. For example, with Java, I would suggest using Struts and Tiles for a simple website like this.
  • You might want to transfer data from Access to the database backend - MSSQL if your institution already has a license, or MySQL or PostgreSQL if you have a zero budget.

From your question, it sounds like it's all new to you. However, this is a small project, so itโ€™s an ideal way to start learning interactive websites.

+1
source

If you are looking for access to the database on the client side, then what everyone else said.

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

+1
source

JavaScript (or any language on the client side) does not have access to what is still on the server. Itโ€™s best to use an AJAX implementation and create a series of web services that you can request from your JavaScript and return the results in a user-friendly format (most likely JSON).

0
source

Here is a simple ASP (vbscript) script that will output your data to a table. You can edit the path and query to suit your situation. As mentioned by others, it does not provide decent security.

Name it with FILENAME.asp? regno = xxxxx

<% Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:/YourDatabase.mdb" SQL = "Select * from TABLENAME where regno=" & request("regno") set RS= Conn.execute(SQL) %> <table> <tr> <% for x=0 to rs.fields.count-1 %> <th><%=RS.fields(x).value%></th> <% next %> </tr> <% do until RS.eof %> <tr> <% for x=0 to rs.fields.count-1 %> <td><%=RS.fields(x).value%></td> <% next %> </tr> <% rs.movenext %> <% loop %> </table> <% RS.close() set Conn=nothing %> 
0
source

You can use PHP to transfer login data to the access database so that you can provide a more secure login. Better still use mySql with PHP.

0
source

All Articles