Display access database information in HTML / Javascript.

carlspywell
carlspywell used Ask the Experts™
on
My ultimate goal is to have data from an Access DB dynamically updating a Vista Gadget. Looking at it so far the coding is done in a HTML file and uses Javascript.

I am new to javascript and wondered if i could display the result on a web page that is dynamically linked to an Access Database?

I have a DB with a form that basically is displaying totals. The Text boxes on the form have a Control Source of =DCount("*","STATS","Brand = 'Brand1'") that return the total number of brands = "Brand1"

The Form also has an 'On Timer' event to refresh the form every minute.

Can this be transoposed onto a web page using Javascript / HTML to display the info and refresh it automatically (the refresh is a less important issue but if possible then i'll use it)

Unles theres an easier way to display Access Data in a gadget then thats great.

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014

Commented:
You can certainly use your Access data with a web-based page, but this has little to do with Access and a LOT to do with web-based programming languages. I'm not sure about the Vista Gadgets portion, but it's fairly straight forward to build a small ASP.NET app that would hook up to your Access database and display data using that.

I'd also suggest you ask the Moderators to include other web-based zones in this question. Use the Request Attention button and ask them to change the Zones.
RobOwner (Aidellio)
Most Valuable Expert 2015

Commented:
Javascript will give you the ability to dynamically reload sections of the web page without reloading the page as a whole.
The best thing to do is download a javascript library such as mootools www.mootools.net (http://mootools.net/download/get/mootools-core-1.3-full-nocompat-yc.js) or jQuery and use their simplified functions for achieving what you want.
Then decide what server language you want to use such as ASP or PHP.  Work with whatever you are more familiar with as both will do the job as long as it's on a windows server, otherwise PHP would be the way to go.

so ASP/PHP acts as a "middle man" between the users interface and the database

 javascript <-----> ASP/PHP <------> database

an example of asking for data from the server and then automatically updating the html:
the GetData function could be set up in javascript to be called at a specified interval.
The request passes an 'id' to the data.php script.  Based on this 'id' it gets data from the database and passes it back to the javascript.  The javascript updates the inner html of the element with the id 'my_data' with whatever the output is from the data.php script
function GetData(element) {
	var myRequest = new Request.HTML(
		{
			url: 'data.php',
			method: 'post',
			data: 'id=' + element.id,
			link: 'ignore',
			update: $('my_data')
		}
	);
	myRequest.send();
}

Open in new window

Commented:
MS Access is not the solution. Who will be using this html page? Internal or external users? How many?  It sounds like the best answer is ASP.Net if you stick with Microsoft technologies, but you might have to upgrade your DB to MS SQL.  I have a few customers that do their back office work in MS Access and front end users in ASP.Net both linked to an MS SQL Server DB.
jrb1senior developer
Top Expert 2005

Commented:
Maybe using an ASP page (not .net) to read the DB.  You could put the 1 minute refresh on the HTML.

http://www.webwiz.co.uk/kb/asp_tutorials/connecting_to_a_database.asp

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial