从我的web应用程序连接到本地sqlexpress数据库



我需要添加一个功能,以便从我的web应用程序连接到本地sqlexpress数据库。这些是从javascript中生成的选项吗?我可以用html5来实现,但不是每个浏览器都支持它。

提前感谢。。。

看看这个:

var connection = new ActiveXObject("ADODB.Connection") ;
var connectionstring="Data Source=<server>;Initial Catalog=<catalog>;User ID=<user>;Password=<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;

最新更新