INDEX

JavaScript - MDB connection sample

Using Javascript is a sample code that displays connected to the MDB the data on the screen.

< script type="text/javascript">
< !--
var objADO = new ActiveXObject("ADODB.Connection");
objADO.Open("Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\\test01.mdb;password=[MDB password]");
var objRS = objADO.Execute("select * from tbl01");
if (objRS.Eof==true){
	document.write("no data.");
}else{
	while(objRS.Eof==false){
		document.write(objRS("col1") + "," + objRS("col2") + "< br />");
		objRS.MoveNext();
	} 
}
objRS.Close();
objADO.Close();
objRS = null;
objADO = null;
//-->
< /script>


Copyright(c) 2007-2020 coding.dojeun.com All Rights Reserved.