日期:2014-05-16 浏览次数:20360 次
var conn = new ActiveXObject("Adodb.Connection"); var filePath = location.href.substring(0, location.href.indexOf("1.html")); var path = filePath + "guanggao.mdb"; path = path.substring(8); document.write(path) conn.Provider = "Microsoft.Jet.oledb.4.0"; conn.ConnectionString ="data source="+path; document.write("3") conn.open; document.write("4") var rs = new ActiveXObject("ADODB.Recordset"); rs.open("select * from youxiajiao where zt=0", conn) if(rs.eof) { rs.close(); rs = null; rs = new ActiveXObject("ADODB.Recordset"); conn.execute("update youxiajiao set zt=0"); rs.close(); rs = null; rs = new ActiveXObject("ADODB.Recordset"); rs.open("select * from youxiajiao where zt=0", conn); } var id1=rs.Fields("id"); var title1=rs.fields("title"); var url1=rs.fields("url"); rs.close(); rs = null; rs = new ActiveXObject("ADODB.Recordset"); conn.execute("update youxiajiao set zt=1 where id="+id1); rs.close(); rs = null; conn.close(); conn = null;