日期:2014-05-17  浏览次数:20757 次

ASP中修改记录问题
代码是这样的
__________传递ID页面__________________
<%  
set   rs=server.createobject( "adodb.recordset ")
sql= "select   *   from   ZX_user "    
rs.open   sql,conn,1,1  
%>  
<%do   while   not   rs.eof%>
        <tr>
            <td   height= "24 "> <div   align= "center "   class= "STYLE1 "> <%=rs( "UserName ")%> </div> </td>
            <td> <div   align= "center "   class= "STYLE1 "> <a   href= "useredit.asp?ID= <%=rs( "ID ")%> "> 编辑 </a> / <a   href= "userdel.asp?ID= <%=rs( "ID ")%> "> 删除 </a> </div> </td>
        </tr>
<%  
rs.movenext  
loop  
%>  

    </table>
    <%
    rs.close  
set   rs=nothing  
%>
_______________修改页面_________________________
<!--#include   file= "Conn.ASP "-->
<%
set   rs=server.createobject( "adodb.connection ")
sql= "select   *   from   ZX_user   where   ID= "&request( "ID ")
rs.open   sql,conn,1,3
%>
<table   align= "center ">
<tr>
<td>
<form   name= "form1 "   method= "post "   action= "usereditsave.asp?id= <%=rs( "ID ")%> ">  
姓&nbsp;&nbsp;&nbsp;名: <input   type= "text "   id= "name "   name= "name " value= " <%=rs( "UserName ")%> "> <br   >  
密&nbsp;&nbsp;&nbsp;码: <input   type= "password "   name= "password " value= " <%=rs( "PassWD ")%> "   > <br>
全&nbsp;&nbsp;&nbsp;名: <input   type= "text "   name= "fullname "   value= " <%=rs( "fullname ")%> "> <br>  
userzx&nbsp;: <input   type= "text "   name= "userzx "   value= "11 "> <br>
purview: <input   type= "text "   name= "purview "   value= "99999 "> <br>
OSKEY&nbsp;&nbsp;: <input   type= "text "   name= "OSKEY "   value= "super "> <br>
<input   type= "submit "   value= "提交 ">  
</form>
</td>
</tr>
</table>
<%
rs.close  
set   rs=nothing  
%>
请问为什么我姓名,密码和全名的文本框读不了数据库的数据呢??

------解决方案--------------------
set rs=server.createobject( "adodb.connection ")
这个应该是:
rs=server.createobject( "adodb.recordset ")