html
head
script language="JavaScript"
function getSubmit()
{
var Firstn = names.value;
var LastName =surname.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(Fname, Lname) VALUES ( '"+ Firstn +"', '" + LastName +"')";
var SQL = "select Surname from Customers where Fname = '" + 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="button" value="submit" onclick="getSubmit()"
/body
/html
No comments:
Post a Comment