主题:  字段数据类型不匹配?

007xo

职务:普通成员
等级:1
金币:0.0
发贴:32
注册:2004/4/30 17:07:10
#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">&nbsp;&nbsp;<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字段,怎么会类型不匹配?



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
注册:2004/1/14 19:14:47
#22005/4/4 17:36:50
typeid数字型不需要引号