搜索用不了回车键,大家看看,用变量定义。
xfxq 2003-08-25 09:43:43 错误如下:
Microsoft OLE DB Provider for SQL Server 错误 '80040e14'
在关键字 'ORDER' 附近有语法错误。
detail.asp,行101
主要代码如下:
<form name="form1" method="get" actiondetail.asp">
<table width="100%" border="0" cellspacing="0" height="40">
<tr valign="top">
<td width="427" valign="bottom" height="15"> 请输入名字:
<input type="text" name="Name" size="30">
</td>
<td width="164" valign="bottom" height="15">
<input type="submit" name="UseFind" value="查询">
</td>
</tr>
</table>
</form>
<%'不同方式进入此页,查询语句不同
if strUseFind <> "" then '使用查询方式
strSql = "SELECT * FROM NYan WHERE YName LIKE '%" & strYName & "%'"
if strYName <> "" then
strSql = strSql & " AND YName LIKE '%" & strYName & "%'"
end if
strSql = strSql
else '直接进入方式
strSql = "SELECT * FROM NYan WHERE "
strSql = strSql
end if
strSql = strSql & " ORDER BY ID DESC"
rs.Open strSql, Conn, 3, 1
%>
请各位指教了,如何敲回车键也可以进行查询,谢谢。