关于ASP+SQL的语句

来源:百度知道 编辑:UC知道 时间:2024/05/16 06:38:37
我的数据库名是"HwWeb",表名为“Interphone”里面有四个字段“Id,DepartmentId,Intertel,EmployeeName”,我现在想在ASP页面上显示所有表里面信息并可以逐条编辑修改删除里面内容,求代码!!!代码!!!最好详细点,因为本人比较菜!

这样搞就太长了,或者要几个页面的代码,还是让别人回吧,呵呵

<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath
'连接user.mdb数据库
set rs=server.CreateObject("adodb.recordset") ('建立recordset对象)
sql="select * from message" ('查询数据库中message表中的所有记录)
set rs=conn.execute(sql) ('返回记录集)
%>
<table width="700" border="1" align="center">
<tr>
<td>ID</td>
<td>Intertel</td>
<td>Department</td>
<td>EmployeeName</td>
</tr>
<%Do while not rs.eof%>('没有到达记录尾时循环输出以下记录)
<tr>
<td><%=rs("id")%></td>('输出表里的记录值)
<td><%=rs("Intertel")%></td>
<td><%=rs("Department")%></td>
<td><%=rs("Emplo