主题:有个关于查询的问题,请大家指教
有个小小的查询程序,感觉没有错误,但总是查不出来,不知是什么原因,请各位指教一下
<html>
<body>
<form action="tsd2.asp" method="post">
<input type=text name="modelno">
<input type=submit >
<input type=reset>
</form>
</body>
</html>
tsd2.asp
<%
modelno=request.form("modelno")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&amp;server.mappath("product.mdb")
exec="select * from tsd where modelno='+modelno+'"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<html>
<body>
<table width="200" border="1" cellspacing="1" cellpadding="1">
<%
do while not rs.eof
%>
<tr><td width=200 align="center"><img src="img/spotlights/<%=rs("modelno")%>.jpg" width=100 height=100 ></td> </tr>
<tr><td width=200>Model No.:<%=rs("modelno")%></td> </tr>
<tr><td>Color:<%=rs("color")%></td></tr>
<%
rs.movenext
loop
%>
</table>
</body>
</html>
<html>
<body>
<form action="tsd2.asp" method="post">
<input type=text name="modelno">
<input type=submit >
<input type=reset>
</form>
</body>
</html>
tsd2.asp
<%
modelno=request.form("modelno")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&amp;server.mappath("product.mdb")
exec="select * from tsd where modelno='+modelno+'"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<html>
<body>
<table width="200" border="1" cellspacing="1" cellpadding="1">
<%
do while not rs.eof
%>
<tr><td width=200 align="center"><img src="img/spotlights/<%=rs("modelno")%>.jpg" width=100 height=100 ></td> </tr>
<tr><td width=200>Model No.:<%=rs("modelno")%></td> </tr>
<tr><td>Color:<%=rs("color")%></td></tr>
<%
rs.movenext
loop
%>
</table>
</body>
</html>