我似乎无法弄清楚为什么我会收到错误“对象不支持此属性或方法”据我所知,我似乎在做所有事情。
任何帮助是极大的赞赏。
谢谢
function test() {
try {
alert("running function test...")
var cn = new ActiveXObject("ADODB.Connection")
var sql = "SELECT * FROM tbl_rssims"
var db = "G:\\AS\\Asf\\ASF\\RSSIMS\\db\\rssims.mdb"
cn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " + db + "")
rs = cn.Execute(sql);
var trs = [ ];
while ( ! rs.EOF )
{
var tr = [ ];
for ( var td = 1; td <= 2; ++td )
{
if ( ! rs.EOF )
{
var flds = [ ];
for ( var f = 0; f < rs.fields.length; ++f )
{
flds.push( rs.fields(f).value );
}
trs.MoveNext();
tr.push( flds.join("<br/>") );
} else {
tr.push( " " );
}
}
trs.push( "<td>" + tr.join("</td><td>") + "</td>\n" );
}
rs.close
cn.close
var html = '<!DOCTYPE html>\n'
+ "<html><body" +
+ '<table style="border: none; table-layout: fixed; width: 100%; text-align: left;" cellpadding="0" cellspacing="0">\n'
+ "<tr>" + trs.join("</tr><tr>") + "</tr>"
+ '</table></body></html>';
window.open('','').document.write(html)
}//end of try
catch(e) {
alert(e.description)
}
}//end of function