</TR>
</table>
</form>
</body>
</html>
向界面输入完信息之后,点击添加转入 ASP 解决程序:
(1)“condb.asp”程序如下:
<%
set conn=server.CreateObject("adodb.connection")
set urs=server.CreateObject("adodb.recordset")
set ers=server.CreateObject("adodb.recordset")
usqlstr="select * from user"
esqlstr="select * from emp"
connstr="driver={Microsoft Access Driver (*.mdb)};DBQ=" &Server.MapPath("zhgdb.mdb") '与
参数顺序无关
conn.open connstr
'将 Recordset 输出成 HTML “表格”
Sub list(rs)
' Part I:输出数据库“表头”
Response.Write "<CENTER><TABLE BORDER=1>"
Response.Write "<TR BGCOLOR=#00FFFF>"
For i=0 to rs.Fields.Count-1
Response.WRITE "<TD>" & rs.Fields(i).Name & "</TD>"
Next
Response.Write "</TR>"
' Part II:输出数据库“内容”
While Not rs.EOF
评论0
最新资源