或者用js连接数据库
var ConnDB = new ActiveXObject("adodb.connection");
var rs = new ActiveXObject("ADODB.Recordset");
ConnDB.ConnectionString="DSN=127.0.0.1;uid=root;pwd=***";
ConnDB.open
rs.open(sql,ConnDB,1,1);
if (rs.RecordCount>0){
if (v==parseInt(rs("MainID"))){
document.all('txt').value = v + rs("MainValue");
var sql=null;
rs.close
ConnDB.close
return;