我需要使用javascript打開位於服務器中的訪問數據庫。我使用此代碼嘗試:使用Javascript在服務器中打開數據庫
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);
.... 但調試這個錯誤:
ReferenceError: ActiveXObject is not defined
如何我可以加載的ActiveXObject的ADODB.Connection和界定呢?
'ActiveXObject'僅在Internet Explorer中可用。 –
[ActiveXObject未定義並且找不到變量:ActiveXObject]的可能重複(http://stackoverflow.com/questions/11101641/activexobject-is-not-defined-and-cant-find-variable-activexobject) –