Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

1.

<html>
2. <head>
3. <title>Entitled Document</title>
4. <script language="JavaScript" >
5.
6. function getSubmit()
7. {
8.
9. var Firstn = names.value ;
10.
11. var cn = new ActiveXObject("ADODB.Connection");
12.
13. var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:/clientDB.mdb";
14. var rs = new ActiveXObject("ADODB.Recordset");
15.
16.
17. var SQL = "select Surname, DOB from Customers where FirstName = '" + Firstn + "'";
18.
19. cn.Open(strConn);
20. rs.Open(SQL, cn);
21. surname.value = rs(1);
22. DOB.value = rs(2);
23.
24. rs.Close();
25. cn.Close();
26.
27.
28. }
29.
30. </script>
31. </head>
32. <body>
33.
34. <input type="text" name="names" />
35. <input type="text" name="surname" />
36. <input type="text" name="DOB" />
37. <input type="button" value="submit" onclick="getSubmit()">
38.
39. </body>
40. </html>

You might also like