asp数据库更新
代码如下:<%ifrequest("id")<>""thenSetconn=server.CreateObject("adodb.connection")connstr=...
代码如下:
<%
if request("id")<>"" then
Set conn=server.CreateObject("adodb.connection")
connstr="provider=microsoft.jet.oledb.4.0;data source="&server.mappath("txl.mdb")
conn.open connstr
set rs=server.createobject("adodb.recordset")
sql="select * from t_student where d_no='"&request.QueryString("id")&"'"
rs.open sql,conn,1,1
%>
<%
response.write"<form name=form1 action=adduser.asp method=post>"
response.write"班级:<input type=text name=class size=20 value=<%=rs("d_class")%>><br>"
response.write"学号:<input type=text name=no size=20 value=<%=rs("d_no")%>><br>"
response.write"姓名:<input type=text name=username size=20 value=<%=rs("d_name")%>><br>"
response.write"<input type=submit name=submit value=提交 onclick=check() >"
response.write"<input type=reset name=reset value=重置>"
response.write"</form>"
%>
<%
conn.close
Set conn = nothing
end if
%>
报错:
response.write"班级:<input type=text name=class size=20 value=<%
-----------------------------------------------------------------
=rs("d_class")%>><br>"
-----^ 展开
<%
if request("id")<>"" then
Set conn=server.CreateObject("adodb.connection")
connstr="provider=microsoft.jet.oledb.4.0;data source="&server.mappath("txl.mdb")
conn.open connstr
set rs=server.createobject("adodb.recordset")
sql="select * from t_student where d_no='"&request.QueryString("id")&"'"
rs.open sql,conn,1,1
%>
<%
response.write"<form name=form1 action=adduser.asp method=post>"
response.write"班级:<input type=text name=class size=20 value=<%=rs("d_class")%>><br>"
response.write"学号:<input type=text name=no size=20 value=<%=rs("d_no")%>><br>"
response.write"姓名:<input type=text name=username size=20 value=<%=rs("d_name")%>><br>"
response.write"<input type=submit name=submit value=提交 onclick=check() >"
response.write"<input type=reset name=reset value=重置>"
response.write"</form>"
%>
<%
conn.close
Set conn = nothing
end if
%>
报错:
response.write"班级:<input type=text name=class size=20 value=<%
-----------------------------------------------------------------
=rs("d_class")%>><br>"
-----^ 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询