ASP的问题请帮我一下

来源:百度知道 编辑:UC知道 时间:2024/05/14 02:10:11
1、首页通过<A href=morefcxw.asp?classid=<%=fcxw("classid")%>><%=fcxw("title")%></A> 把CLASSID参数传递给morefcxw.asp
2、fcxwmore.asp
<!--#include file=top.asp-->
<!--#include file="conn.asp"-->
<%
idid=request.querystring("classid")
response.write idid
Set fcxwmore= Server.CreateObject("ADODB.Recordset")
sqll="select title,content,classid from class where classid='"&idid&"' "
fcxwmore.open sqll,conn,1,1
%>
<body>
<table width="500" border="0">
<tr>
<td><%=fcxwmore("title")%></td>
</tr>
<tr>
<td><%=fcxwmore("content")%></td>
</tr>
</table>
</body>
</html>
说明classid用的是ACCESS里面自动的值,不知道为什么就是读不到表里面的标题和内容,请大家帮我是不是sqll="select t

sqll="select title,content,classid from class where classid='"&idid&"' " 错误

sqll="select title,content,classid from class where classid="&idid&""

classid为数字整型,不应加单引号,字符型才加单引号

SQL语句错了,自动编号的不需要加单引号:
sqll="select title,content,classid from class where classid="&idid&" "

classid 一般不是 字符型的吧,不要 加 \'

sqll=\"select title,content,classid from class where classid=\"&idid&\"\"