1.创建connection对象
2.创建recordset对象
var oConn = new ActiveXObject("ADODB.Connection"); try { oConn.ConnectionString ="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=SA;Initial Catalog=pubs;Data Source=."; oConn.Open("","","",0); oConn.Close(); document.writeln("Good"); } catch(e) { alert(e.description); }