JavaScript中操作Mysql數(shù)據(jù)庫實(shí)例_javascript技巧
來源:懂視網(wǎng)
責(zé)編:小采
時(shí)間:2020-11-27 21:36:35
JavaScript中操作Mysql數(shù)據(jù)庫實(shí)例_javascript技巧
JavaScript中操作Mysql數(shù)據(jù)庫實(shí)例_javascript技巧: //創(chuàng)建數(shù)據(jù)庫連接對象 var conn = new ActiveXObject(ADODB.Connection); //創(chuàng)建數(shù)據(jù)集對象 var rs = new ActiveXObject(ADODB.Recordset); try{ //數(shù)據(jù)庫連接串,具體配置請參考:http://www.connectionstrings.
導(dǎo)讀JavaScript中操作Mysql數(shù)據(jù)庫實(shí)例_javascript技巧: //創(chuàng)建數(shù)據(jù)庫連接對象 var conn = new ActiveXObject(ADODB.Connection); //創(chuàng)建數(shù)據(jù)集對象 var rs = new ActiveXObject(ADODB.Recordset); try{ //數(shù)據(jù)庫連接串,具體配置請參考:http://www.connectionstrings.
輸出記錄的內(nèi)容
WScript.Echo(rs.Fields("id") + "\t" + rs.Fields("name") + "\n");
//下一條記錄
rs.moveNext();
}
//關(guān)閉記錄集
rs.close();
//關(guān)閉數(shù)據(jù)庫連接
conn.close();
} catch(e){
//異常報(bào)告
WScript.Echo(e.message);
} finally{
//
}
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
JavaScript中操作Mysql數(shù)據(jù)庫實(shí)例_javascript技巧
JavaScript中操作Mysql數(shù)據(jù)庫實(shí)例_javascript技巧: //創(chuàng)建數(shù)據(jù)庫連接對象 var conn = new ActiveXObject(ADODB.Connection); //創(chuàng)建數(shù)據(jù)集對象 var rs = new ActiveXObject(ADODB.Recordset); try{ //數(shù)據(jù)庫連接串,具體配置請參考:http://www.connectionstrings.