34,872
社区成员
发帖
与我相关
我的任务
分享<form name="form2" action="search.asp">
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center">条件查询:
<select name="select">
<option value="name" selected>按姓名</option>
<option value="inno">按住院号</option>
<option value="intime">按住院时间</option>
<option value="outtime">按出院时间</option>
</select>
关键字:
<input name="kws" type="text" size="18" />
<input type="submit" name="Submit" value="提交" />
</div>
</label></td>
</tr>
</table>
</form>
<%
kws=trim(request.Form("kws"))
sel=request.Form("select")
set rs=server.CreateObject("ADODB.RecordSet")
rs.open "select * from user where name='"&kws&"'",conn,1,1
%>
<%
do while not rs.eof
%>
</p>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="132"><div align="center">住院号</div></td>
<td width="133"><div align="center">姓名</div></td>
<td width="133"><div align="center">性别</div></td>
<td width="133"><div align="center">年龄</div></td>
<td width="133"><div align="center">入院时间</div></td>
<td width="133"><div align="center">出院时间</div></td>
</tr>
</table>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<a href="show.asp?id=<%=rs("id")%>">
<td width="132"><div align="center"><%=rs("inno")%></div></td>
<td width="133"><div align="center"><%=rs("name")%></div></td>
<td width="133"><div align="center"><%=rs("sex")%></div></td>
<td width="133"><div align="center"><%=rs("age")%></div></td>
<td width="133"><div align="center"><%=rs("intime")%></div></td>
<td width="133"><div align="center"><%=rs("outtime")%></div></td>
</a> </tr>
<%
rs.movenext
loop
%>
<%if rs.eof and rs.bof then%>
<p>没有找到记录</p></br></br>
<%end if%>
</table>rs.open "select * from user where '"&sel&"'='"&kws&"'" ,conn,1,1<form name="form2" action="search.asp">
实际是:<form name="form2" method="post" action="search.asp">"select * from user where '"&ColumnName&"'='"&Key&"'" "select * from user where '"&"'ColumnName='"&Key&"'"