<!--#include file=conn.asp--> <% set rs=server.CreateObject("ADODB.Recordset") sql="selcet top 5 * form new where title order by time desc" rs.open sql,conn,1,1 if rs.eof or rs.bof then response.write ("暂时没有文章") else %> <table width="800" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="229" height="334" valign="top"> <table width="218" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="25" background="image/left_menu.gif"> </td> </tr> </table> <table width="218" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> </table></td> <td width="571" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr background="image/menu.gif"> <td height="25"> </td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <%do while not rs.eof%> <tr> <td width="5%" align="center" valign="middle"><div align="center"><img src="image/newD.gif" width="10" height="10"></div></td> <td width="95%"> <%=rs("title")%></td> </tr> <% rs.movenext loop rs.close end if %> </table></td> </tr> </table> 怎看第五行是没有问题吧,就是出错,以下是IE的提示 "技术信息(用于支持人员) 错误类型: Microsoft JET Database Engine (0x80040E14) 无效的 SQL语句;期待 'DELETE'、'INSERT'、'PROCEDURE'、'SELECT'、或 'UPDATE'。 /test/index.asp, 第 5 行"
sql="selcet top 5 * form new where title order by time desc" 检查一下单词拼写。 另外这条 SQL 的内容,你按照英文字面来阅读,是否可以读通呢? 错误提示中已经明确说明是 SQL 语句无效,所以检查 SQL 语句即可。
sql="selcet top 5 * form new where title order by time desc" SQL=“Select top 5 * from new order by time desc” where 在这有没有比较的数据为什么写呢