#12005/4/4 17:34:13
有一个TYPE表,设定的是保存大类文章,TYPEDI是自动编号的字段;
一个ARTICLE表,保存具体文章的内容,TYPEID是数字型字段;
一个NTYPE表,保存小类文章,TYPEID是数字型字段
我在首页调用
<%typeid=(文章类别)%>
<!--#include file="xinwen/news_online.asp"-->
其中NEWS_online.asp为:<%
Set rs = Server.CreateObject("ADODB.RECORDSET")
rs.CursorLocation = 3
'response.Write(dbconn)
'response.End()
[color=Orange]rs.Open "select top 10 * from article where typeid='"& typeid &"' order by newsid desc",conn[]/red]
%>
<table width="100%" border="0" cellspacing="0">
<%i = 0
Do While i < 5 And Not rs.EOF%>
<tr>
<td width="100%" height="20" valign="bottom"> <img src="../image/bg_d.jpg" width="5" height="5">
<a href="../xinwen/show.asp?id=<%=rs.Fields("newsid")%>" target="_blank" title="<%=rs("title")%>"><%=left(rs.Fields("title"),12)%></a> </span></td>
</tr>
<%
rs.MoveNext
i = i + 1
Loop
rs.Close
Set rs = Nothing
%>
</table>
调用提示数据类型不匹配
在rs.Open "select top 10 * from article where typeid='"& typeid &"' order by newsid desc",conn这一句上面,我查看了在我的ARTICLE表里面有个TYPEID字段,怎么会类型不匹配?