[求助]如何向同一字段一次提交多个表单?
例如下面:将1234表中的newname字段的值读出,再一次写入123表的name字段中:
表1234
newname id
cheng 2
jiang 1
liang 3
......................
123表
id name
6 *****
请大哥帮忙在下面的代码上修改实现一下,谢谢!
<%
if request.QueryString("add")="add" then
dim connstr
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("123.mdb")
set conn=server.CreateObject("adodb.connection")
conn.open connstr
set rs=server.CreateObject("adodb.recordset")
sql="select * from 123"
rs.open sql,conn,1,3
rs.addnew
rs("name")=request.Form("name")
rs.update
rs.close
set rs=nothing
response.Write("插入成功")
end if
%>
<form id="form1" name="form1" method="post" action="index.asp">
<table width="50%" border="1" align="center" cellpadding="1" cellspacing="1">
<tr>
<td height="221"><table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td align="center">
<%
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("123.mdb")
set conn=server.CreateObject("adodb.connection")
conn.open connstr
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from 1234"
rs1.open sql1,conn,1,1
do while not rs1.eof
%>
<input name="name" type="text" id="name" value="<%=rs1("newname")%>" /><br>
<%
rs1.movenext
loop
conn.close
set conn=nothing
%> </td>
</tr>
</table>
<input name="add" type="hidden" id="add" value="add" /></td>
</tr>
<tr>
<td align="center"><input type="submit" name="Submit" value="提交" /></td>
</tr>
</table>
</form>
[此贴子已经被作者于2007-3-14 19:15:02编辑过]