程序取现有行的列信息出错
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
dim ID
dim rs
dim sql
dim Conn
ConnStr="driver={sql server};server=127.0.0.1;database=tire;uid=sa;pwd=111111"
set Conn=server.createobject("adodb.connection")
Conn.Open ConnStr
Set rs=server.CreateObject("ADODB.recordset")
ID=request.QueryString("产品编号")
Response.Write("产品编号ID为:"&ID&" <br>")
sql="select * from chanpin3 where 产品编号='"& ID &"'"
if request("产品编号")<>"" and Submit<>"提交" then
rs.Open sql,Conn,1,1
if rs.EOF or rs.BOF then
Response.Write("<hr>数据库中暂无资料!")
Else
do while not rs.EOF or rs.BOF
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>修改信息</title>
<style type="text/css">
<!--
.STYLE 7{font-size:12px; font-family:"宋体";}
.STYLE 8{font: bolder "宋体"; font-size:12px; color:#990000;}
.STYLE 9{font-size:12px; color:#990000; font-weight:bold;}
.STYLE 10{font-size:12px; color:#FFFFFF; font-weight:bold;}
-->
</style>
</head>
<body>
<div align="center" class="STYLE 7">
<p align="left"><font size="+6"><font face="宋体"><font color="#0000FF" face="幼圆"><img src="head_nJwL_41440b206096.jpg" width="74" height="104" align="middle">产品信息管理系统</font></font></font></p>
<form action='gain.asp?产品编号=<%=rs("产品编号")%>' method="post" name="form1">
<table width="66%" border="1" align="center" bordercolor="#0066FF">
<tr>
<td height="25" colspan="2" background="head_9qb2_41903n206096.jpg"><div align="center"><span class="STYLE 2">修改产品信息</span></div></td></tr>
<tr bordercolor="#FFFFFF"><td width="20%"><div align="center"><span class="STYLE 8">产品编号:</span></div></td>
<td width="80%"><div align="left"><span class="STYLE 7">
<input name="text1" type="text" class="STYLE 7" id="text1" value="<%=rs("产品编号")%>" readonly="false">
</span></div></td></tr>
<tr bordercolor="#FFFFFF">
<td><div align="center"><span class="STYLE 8">产品名称:</span></div></td>
<td><div align="left"><span class="STYLE 7"><input name="text2" type="text" class="STYLE 7" id="text2" value="<%=rs("产品名称")%>" size="40">
</span></div></td></tr>
<tr bordercolor="#FFFFFF"><td><div align="center"><span class="STYLE 8">产品型号:</span></div></td>
<td><div align="left"><input name="text3" type="text" class="STYLE 7" id="text3" value="<%=rs("产品型号")%>" size="50">
</div></td></tr>
<tr bordercolor="#FFFFFF"><td><div align="center"><span class="STYLE 8">制造商:</span></div></td>
<td><div align="left"><input name="text4" type="text" class="STYLE 7" id="text4" value="<%=rs("制造商")%>" size="50">
</div></td></tr>
<tr bordercolor="#FFFFFF"><td><div align="center"><span class="STYLE 8">产地:</span></div></td>
<td><div align="left"><input name="text5" type="text" class="STYLE 7" id="text5" value="<%=rs("产地")%>" size="50">
</div></td></tr>
<tr bordercolor="#FFFFFF"><td><div align="center"><span class="STYLE 8">价格:</span></div></td>
<td><div align="left"><input name="text6" type="text" class="STYLE 7" id="text6" value="<%=rs("价格")%>" size="50">
<%
rs.movenext
loop
end if
set rs=nothing
set conn=nothing
%>
</div></td></tr>
<tr><td height="38" colspan="2" bordercolor="#FFFFFF"><div align="center">
<input name="Submit" type="submit" class="STYLE 7" value="提交" onClick="window.open('gain.asp')">
<input name="reset" type="reset" class="STYLE 7" value="重填" onClick="window.open('gainnew.asp')">
</div></td></tr>
</table>
</form></div>
</body>
</html>
请问:我的程序是在该行后点上修改按钮后,获取所在行“产品编号”的值,继而修改信息,请问我的ID为什么总是取空值啊!谢谢啦!
[解决办法]
你如果刚写的程序 数据库里面有数据吗 如果数据库里面就没有数据 当然是空的了