在线等,这该怎么插tobe的数据进相应的数据库啊,江湖告急!
该图上的三行是从数据库里读除来的,我需要每行后面都添加一文本框输入transfer给谁,该怎么做让这一列文本框的数据依次传到数据库里相应的列里啊。因为我发现我把这一列的数据全插到一行里了。<%@ LANGUAGE="vbscript" %>
<!--#include virtual ="/Include/Conn.asp"-->
<!--#include virtual ="/Include/Frequent.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" c>
<meta name="GENERATOR" c>
<meta name="ProgId" c>
<title>Let's begin</title>
</head>
<body bgcolor="#FFFFFF">
<form method="post" name="Form1" action="dealtransfer.asp">
<table width="733" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="111" height="30">
<div align="center"><font color="#3366FF" face="Verdana, Arial, Helvetica,sans-serif"><b><font size="2">Barcode</font></b></font></div>
</td>
<td width="111">
<div align="center"><font color="#3366FF" face="Verdana, Arial, Helvetica, sans-serif"><b>XCVR</b></font></div>
</td>
<td width="111">
<div align="center"><font color="#3366FF" face="Verdana, Arial, Helvetica, sans-serif"><b>Product Name<br>
</b></font></div>
</td>
<td width="111">
<div align="center"><font color="#3366FF" face="Verdana, Arial, Helvetica, sans-serif"><b>mydate<br>
</b></font></div>
</td>
<td width="111">
<div align="center"><font color="#3366FF" face="Verdana, Arial, Helvetica, sans-serif"><b>Transfer to(Badge:exg 7477ME)<br>
</b></font></div>
</td>
</tr>
<%
MyAccount = GetAccount()
owner = GetBadge(MyAccount)
mydate = now()
session("owner") = owner
set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
c
conn.open = constr
rs.open "select * from mtrack1 where (Barcode IN(SELECT barcode FROM mtrack2 WHERE Owner = '"&Owner&"')) order by dbo.mtrack1.autoid desc",conn,1,1
if rs.eof then
Response.Write("<tr> <td colspan='5' height='30'><i>Sorry there is no barcode need you to transfer</i></td> </tr>")
Else
Do While NOT rs.EOF
response.write "<tr><td>"&rs("Barcode")&"</td><td>"&rs("XCVR")&"</td><td>"&rs("product")&"</td><td>"&rs("mydate")&"</td><td>"
Response.Write "<input type='text' value='' name='tobe'></td></tr>"
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Conn.Close
Set Conn = Nothing
end if
%>
------------------------
接受的代码另一页的
<%@ LANGUAGE="vbscript" %>
<!--#include virtual ="/Include/Conn.asp"-->
<!--#include virtual ="/Include/Frequent.asp"-->
<%
owner = session("Owner")
if owner ="" then
response.Redirect "[url=http://hzmot/quick/m-track/index.htm]http://hzmot/quick/m-track/index.htm[/url]"
else
set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
c
conn.open = constr
rs.open "select barcode FROM mtrack2 WHERE Owner = '"&Owner&"'order by autoid desc",conn,1,1
do while not rs.eof
barcode = rs("barcode")
tobe = Trim(Request.Form("tobe"))
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.open "update mtrack2 set tobe= '"&tobe&"'where barcode='"&barcode&"'",conn,1,3
rs1.close
set rs1 = nothing
rs.movenext
loop
rs.close
set rs = nothing
conn.Close
set conn = nothing
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" c>
<meta name="GENERATOR" c>
<meta name="ProgId" c>
<title>THANKS FOR YOUR SUPPORT</title>
</head>
<body bgcolor="#FFFFFF">
<p> </p>
<table width="733" border="0" cellspacing="0">
<tr >
<td colspan="5">
<p align="center"><b><font size="5" color="#0000FF"> You transfer the barcode
to another usersuccessfully!</font></b></td>
</tr>
<tr >
<td colspan="5">
<p align="center"> </td>
</tr>
<tr><font size="4" color="#0000FF">
<td width="109" >Barcode</td><td width="121">XCVR</td><td width="141">Product</td><td width="124">Transfer to</td><td width="228">Time</td></font>
</tr>
<%
set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
c
conn.open = constr
rs.open "SELECT dbo.MTRACK1.Barcode,dbo.MTRACK1.XCVR,dbo.MTRACK1.Product,dbo.MTRACK2.Tobe,dbo.MTRACK2.mydate FROM dbo.MTRACK1 INNER JOIN dbo.MTRACK2 ON dbo.MTRACK1.Barcode = dbo.MTRACK2.Barcode WHERE (dbo.MTRACK1.Owner = '7477me') ORDER BY dbo.MTRACK1.autoid DESC",conn,1,1
response.write "<tr><td>"&rs("Barcode")&"</td><td>"&rs("XCVR")&"</td><td>"&rs("product")&"</td><td>"&rs("tobe")&"</td><td>"&rs("mydate")&"</td></tr>"
rs.close
set rs=Nothing
conn.Close
Set conn= Nothing
%>
</table>
<table width="733" border="0" cellspacing="0" cellpadding="0" height="40">
<tr>
<td align="center"><a href="javascript:window.close()"><b>CLOSE</b></a></td>
</tr>
</table>
</html>