在一个HTA文件中使用的GetString(Using getstring in a hta fil

2019-10-28 10:16发布

我有一个连接到通过ADO数据库,然后打印到一张桌子一个HTA文件。 但是我的代码在GetString的线触发了语法错误和对象确实在该表的代码的执行document.write部支持的属性或方法“写”错误。 我竭力要弄清楚如何使用此GetString方法从我的理解应该是打印出的表格的最有效方式。

<!DOCTYPE html>
<html>
<title>ARMS Hamburger Site</title>
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="ie=9">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<body>


<!-- Footer -->
<footer class="w3-center w3-light-grey w3-padding-32">
<button">Try it</button>

<script language="javascript">
var today = new Date();
var t0 =  today.getSeconds();
var connection = new ActiveXObject("ADODB.Connection") ;
var table = document.getElementById("myTable");

var connectionstring="Provider=Microsoft.ACE.OLEDB.12.0;Data 
Source=\\\\drivepath\\blah\\filedatabase.accdb;Jet OLEDB:Engine 
Type=5;Persist Security Info=False;Mode=Share Exclusive;"

connection.Open(connectionstring);
var rs = new ActiveXObject("ADODB.Recordset");

rs.Open("SELECT * FROM table", connection);
rs.MoveFirst
var str=rs.GetString(,,"</td><td>","</td></tr><tr><td>"," ");

rs.close;
connection.close; 
var today2 = new Date();
var t1 =  today2.getSeconds();
alert(t1-t0);
</script>

<center>
<table border="1" width="100%">
  <tr>
  <td><script language="javascript">document.Write(str)</script></td>
  </tr>
</table>
</center>
<br>
</footer>
</body>
</html>
文章来源: Using getstring in a hta file