📜  使用 JavaScript 连接 MSSQL - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:13.030000             🧑  作者: Mango

代码示例1
var connection = new ActiveXObject("ADODB.Connection") ;

var connectionstring="Data Source=;Initial Catalog=;User ID=;Password=;Provider=SQLOLEDB";

connection.Open(connectionstring);
var rs = new ActiveXObject("ADODB.Recordset");

rs.Open("SELECT * FROM table", connection);
rs.MoveFirst
while(!rs.eof)
{
   document.write(rs.fields(1));
   rs.movenext;
}

rs.close;
connection.close;