<html> <head> </head> <body> <script> //Js版本 var link1=new ActiveXObject("ADODB.Connection") //使用ADO的Connection对象打开数据库接口 link1.open ("Driver={SQLite3 ODBC Driver}; Database=E://lab//sql//newsfeed.db") //操做指定数据库,Js使用相对地址 var rs=link1.execute("select * from [news_item]") for(i=0;i<10;i++){ if(rs.eof)continue; document.write(rs("url") + " ----- " + rs("title") + "<p>") rs.movenext() } //var rs=link1.execute("create table mmm(a,b,c);") link1.close() //关闭数据库链接 </script> </body> </html>