<script> <br> / /以 JavaScript 寫伺服器端連接資料庫的程式碼範例 <br> var conn = new ActiveXObject("ADODB.Connection"); <br> conn.Open("DBQ=c:\\a.mdb;DRIVER Driver (*.mdb)};"); <br> var rs = new ActiveXObject("ADODB.Recordset"); <br> var 我); <br> shtml = "<table width='100%' border=1>"; <br> shtml ="<tr bphpcn cntd>au_lname<td>au_fname"; <br> while(! rs.EOF) <br> { <br> shtml = "<tr><td>" rs("friend_id") <td>" rs("friend_nickname") " "; <br> rs.moveNext; <br> } <br> shtml = ""; <br> conn.close(); <br> conn = null; <br> </script>