在网页的开始插入如下代码:
<%
Set conn=Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("DBName.mdb")+";Persist Security Info=False"
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.CursorType=1
rs.LockType=1
%>
<%
<%
Dim rs1
Set rs1 = Server.CreateObject("ADODB.Recordset")
sql1 = "select * from table"
rs1.open sql1,conn,1,1
%>
在文章需要显示动态数据的地方插入
<%
if rs1.bof and rs1.eof then
Response.Write("无数据。")
else
i=1
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
%>
<tr><%=rs1(COLName)%></tr>
<%
i=i+1
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
Wend
end if
%>