how to connect ms access database to html webpage

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jul 2007
Posts: 9
Reputation: bapu435 is an unknown quantity at this point 
Solved Threads: 0
bapu435 bapu435 is offline Offline
Newbie Poster

how to connect ms access database to html webpage

 
0
  #1
Jul 30th, 2007
i am developing a website in html in which the contactus page i have to connect to ms access database i am not able to get it ,can any one tell me how to get that one.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: how to connect ms access database to html webpage

 
0
  #2
Jul 30th, 2007
You need to use a server side programming language like ASP to do this. HTML cannot access a database itself.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2
Reputation: mkhizess is an unknown quantity at this point 
Solved Threads: 0
mkhizess mkhizess is offline Offline
Newbie Poster

Re: how to connect ms access database to html webpage

 
0
  #3
Nov 21st, 2007
<html>
<head>
<title>Entitled Document</title>
<script language="JavaScript" >

function getSubmit()
{
var LastName;
var Firstn = names.value ;

var cn = new ActiveXObject("ADODB.Connection");
//here you must use forward slash to point strait
var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:/clientDB.mdb";
var rs = new ActiveXObject("ADODB.Recordset");
//var SQL = "INSERT INTO Customers(FirstName, Surname)"
//+ " VALUES ( '"+ names.value +"', '" + surname.value +"')";
var SQL = "select Surname, DOB from Customers where FirstName = '" + Firstn + "'";

cn.Open(strConn);
rs.Open(SQL, cn);
surname.value = rs(0);
DOB.value = rs(1);
//alert(rs(0));
rs.Close();
cn.Close();


}

</script>
</head>
<body>

<input type="text" name="names" />
<input type="text" name="surname" />
<input type="text" name="DOB" />
<input type="button" value="submit" onclick="getSubmit()">

</body>
</html>
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 85
Reputation: hidash_in has a little shameless behaviour in the past 
Solved Threads: 0
hidash_in's Avatar
hidash_in hidash_in is offline Offline
Junior Poster in Training

Re: how to connect ms access database to html webpage

 
0
  #4
Nov 21st, 2007
hello i cant get output for the above coding pls help.
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 4
Reputation: Shobhit is an unknown quantity at this point 
Solved Threads: 0
Shobhit Shobhit is offline Offline
Newbie Poster

Re: how to connect ms access database to html webpage

 
0
  #5
Nov 22nd, 2007
Originally Posted by hidash_in View Post
hello i cant get output for the above coding pls help.
You have to save the file with .asp extension for the IIS server to interpret it correctly. Also it would be helpful if you post the output you are currently getting, as most probably you giving incorrect path for your access file.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 10
Reputation: techna is an unknown quantity at this point 
Solved Threads: 0
techna's Avatar
techna techna is offline Offline
Newbie Poster

Re: how to connect ms access database to html webpage

 
0
  #6
Nov 29th, 2007
[inline] as far as my knowledge goes u can't achieve this by javascript as well, try doin something like this [/inline]
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <html>
  2. <%@ page import="java.sql.*"%>
  3. <%
  4. var LastName;
  5. var Firstn = names.value ;
  6. var cn = new ActiveXObject("ADODB.Connection");
  7. //here you must use forward slash to point strait
  8. var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:/clientDB.mdb";
  9. var rs = new ActiveXObject("ADODB.Recordset");
  10. //var SQL = "INSERT INTO Customers(FirstName, Surname)"
  11. //+ " VALUES ( '"+ names.value +"', '" + surname.value +"')";
  12. var SQL = "select Surname, DOB from Customers where FirstName = '" + Firstn + "'";
  13. cn.Open(strConn);
  14. rs.Open(SQL, cn);
  15. surname.value = rs(0);
  16. DOB.value = rs(1);
  17. //alert(rs(0));
  18. rs.Close();
  19. cn.Close();
  20. }
  21. catch(Exception e)
  22. {
  23. out.println("error occured:" + e.getMessage());
  24. }
  25. %>
  26. </body>
  27. </html>
[inline] save this as .jsp and add some code for displayin gthe fields. hope this will help u [/inline]
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 1
Reputation: kapil.soni is an unknown quantity at this point 
Solved Threads: 0
kapil.soni kapil.soni is offline Offline
Newbie Poster

Desgn a HTML form using excel database or access database

 
0
  #7
May 30th, 2008
Hi,
any one can help me out i have a excel database and want to show records in a html application; like i have employee code and their quality scores how i can show it in html form by putting emp code.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: how to connect ms access database to html webpage

 
0
  #8
May 31st, 2008
Use the "Save as web page" option in the File menu.

Notice that html can't access a spreadsheet on your computer. You have to upload the changed web page after any changes to the spreadsheet.
Last edited by MidiMagic; May 31st, 2008 at 1:30 am.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 1
Reputation: faulkj is an unknown quantity at this point 
Solved Threads: 0
faulkj faulkj is offline Offline
Newbie Poster

Re: how to connect ms access database to html webpage

 
0
  #9
Apr 21st, 2009
You are able to connect to Microsoft Access using JavaScript when the HTML file is run locally and the Access .mdb file is accessible to the file system it does not work remotely due to the obvious security issues.

I had a situation where this functionality was actually useful, so I wrote a JavaScript library to simplify the process. This library allows you to execute SQL queries in a single command with the option of selecting the output format of the result-set from choices including JSON, XML, and HTML.

I had a great deal of difficulty finding information or examples of how to connect to Access, so I decided to share my code with the world...

The library is called ACCESSdb and you can get it here!

:thumbs:
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 1
Reputation: goaway is an unknown quantity at this point 
Solved Threads: 0
goaway goaway is offline Offline
Newbie Poster
 
1
  #10
24 Days Ago
Hi,

I am creating something similar as discussed above.

I have a access database which has the list of banking centers and their hours of operation ,Monday -Sunday.

Now, i have created a html page, asking the user to select the state from a drop down menu, and the day as checkbox. So that when I click on "Submit Query' button, it gives me all the banking centers of that state open on Monday and at which time.

I want to link this HTML.html file with my access table.
Also, i want to have a out put screen in html/access form which shows the result.

Appreciate, what all you can make available.

Thanks
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC