js链接xammp的数据库哪里错了

var txt1;
var txt2;
var con = new ActionXObject("ADODB.connection");
con.open("Provider = SQLOLEDB.1,Data Source = localhost;User = root"+"password=;Initial Catalog=pubs");
var rs = new ActionXObject("ADODB.Recordset");
var sql = "inster into logtable(username,password) values('txt1','txt2')"
try{
rs.open(sql,con);
rs.close();
con.close();
}
catch(e){
alert(e);
}
哪里错了,谢谢大神

js是客户端代码,怎么去连sql server了呢

js不能连接数据库吗?。。。