| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4921 人关注过本帖
标题:[求助]类型不匹配: 'cint'
只看楼主 加入收藏
chengxiaobo
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2006-11-15
收藏
 问题点数:0 回复次数:15 
[求助]类型不匹配: 'cint'

我在编写下面的程序时,出现了这样的一个错误:错误类型:
Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配: 'cint'
这是什么意思啊, 我搞不懂,我的代码如下:
<!-- #include file="config.inc"-->
<html>
<head><title></title></head>
<style>
<!--
.class1{font:10pt;color:#000080;border-width:1;}
td{font:10pt;}
-->
</style>
</head><body style="font:10pt;margin-left:4pt">
<font color="#ff0000">您的位置:会员社区</font><hr color="#999933" size="1" />
<br />
<a style="color:blue;cursor:hand;font:10pt;text-decoration:underline" onClick="window.open('noteadd.htm','_blank','toolbars=no,scrollbars=yes,width=470,height=440')">添加新留言</a>&nbsp;&nbsp;&nbsp;&nbsp;<font style="font:10pt;color:#cc66ff">如果您看不到自己的留言,单击刷新按钮,稍候即可</font>

<table width=570 border=0 cellpadding="0" cellspacing="1" bordercolor="#baccff">
<%
dim ipagesize
ipagesize=15
page=request.QueryString("page")
if page="" then
page=1
end if
set conn=server.CreateObject("adodb.connection")
conn.open connstring
set objnoters=server.CreateObject("adodb.recordset")
ssql="select * from notebook order by notetime desc"
objnoters.open ssql,conn,1,3
if objnoters.eof then
response.write"目前还没有任何文章信息!"
response.end
end if
response.write"<tr bgcolor=#baccff class=class1 align=center><td width=50>序号</td><td width=140>主题</td><td width=70>作者</td><td width=140>E-mail</td><td width=130>留言时间</td><td width=40>阅读数</td></tr>"
objnoters.pagesize=ipagesize
pagetotal=objnoters.pagecount
objnoters.absolutepage=page
response.Write"<tr><td colspan=""6""><table width=""100%"" border=0 cellspacing=0 cellpadding=2 bgcolor=#eeeeee>"
for position=1 to ipagesize
response.write"<tr align='center'><td width='50'>"
if objnoters("status")=0 then
response.Write cint(right(objnoters("noteid"),5))
else
response.Write"<font color=#ff00ff>回文</font>"
end if
response.write"</td>"
response.write"<td width=150>"
%>
<a style="cursor:hand;color:blue;text-decoration:underline" onClick="window.open('noteview.asp?noteid=<%=objnoters("noteid")%>','_blank','toolbars=no,scrollbars=yes,width=320,height=300')"><%=objnoters("subject")%></a>
<%
response.write"</td>"
response.write"<td width=80>"& objnoters("userid")&"</td>"
response.write"<td width=140>"
%><a href="mailto:<%=objnoters("email")%>"><%=objnoters("email")%></a>
<%
response.write"</td>"
response.write"<td width=130>"&objnoters("notetime")&"</td>"
objnoters.movenext
if objnoters.eof then
exit for
end if
next
%></table></td></tr>
</table>
<%
response.write"&nbsp;&nbsp;&nbsp;页码:"
for pagetemp=1 to pagetotal
if pagetemp=cint(page) then
response.write"<font color=#cc00ff>"&pagetemp&"></font>"
else
%>
<font color=#009900>
<a href="mainnote.asp?page=<%=pagetemp%>"><%=pagetemp%></a></font>
<%
end if
next
%>
</body>
</html>
我现在该怎么办了呢,要改的话,在我这个程序里如何改了呢

搜索更多相关主题的帖子: cint quot Microsoft 类型 font 
2006-12-29 13:54
tang688
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1219
专家分:35
注 册:2004-12-25
收藏
得分:0 
是指你对非数据的东东进行了数据转换
比如cint("123.11")得到的是123
但cint("abc")得到的就是你这样的错误.

2006-12-29 14:14
chengxiaobo
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2006-11-15
收藏
得分:0 
那你说我这个要怎么改啊,我不知道怎么改啊,我这个程序是在书上弄下来的,运行了一下,就有这样的一个错误,里面还有的程序我都有点看不懂,所以啊,就不知道我该怎么改了,你帮我改改了,告诉我要在那里改了,怎么改。
2006-12-29 16:24
做人很低调
Rank: 5Rank: 5
等 级:贵宾
威 望:18
帖 子:1268
专家分:0
注 册:2006-8-2
收藏
得分:0 
你输出一下这个看看显示的是什么?
Response.Write(right(objnoters("noteid"),5))

其实我很低调,只是你不知道...
2006-12-29 17:20
chengxiaobo
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2006-11-15
收藏
得分:0 
我按你的意思写上去了了,有结果的,但是有一个问题,那就是我那个序号啊,只有n,没有后面的数字,我的设置是这样的我那个序号设置了是从n00001开始的,到现在了呢,在页面是显示的只有n而没有数字啊,这是为什么啊。
2006-12-30 12:57
tang688
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1219
专家分:35
注 册:2004-12-25
收藏
得分:0 

这个值是你从数据库中调出的,也就是你得查数据库之前的程序,在写入时的问题.

2006-12-30 13:03
chengxiaobo
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2006-11-15
收藏
得分:0 
写入数据库的程序没问题啊,我调试了,可以啊,没事啊,我不是跟你说了吗,我的那个值是从n00001开始的,我问了别人,他们说cint不能调出非数字,我看了一下数据库,它能写入的,里面存了东西的,呵呵,那你说是怎么弄的啊,要不我把那个n删了,看可以不。要不我把那个写入数据库的程序发到这里,你看呢。
2006-12-30 13:20
tang688
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1219
专家分:35
注 册:2004-12-25
收藏
得分:0 
如果你确定数据库中的值
那么就用这个试试:
response.Write cint(right(trim(objnoters("noteid")),5))

2006-12-30 13:24
chengxiaobo
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2006-11-15
收藏
得分:0 
呵呵,是我自己太粗心了,其实加了你开始的那个句子了呢,是有数据的,只是我昨晚在一个地方改了一下,现在改过来了,没有事的,但是你叫我用response.Write cint(right(trim(objnoters("noteid")),5))这个的时候,它仍然是说类型不匹配,那这是怎么回事了啊,还有就是我呢,在查看我那个留言的时候呢,它就有这样的一个错,下标越界: '[number: 1]'
这是怎么回事了啊,我这个代码是:
<!--#include file="config.inc"-->
<%
set conn=server.CreateObject("adodb.connection")
conn.open connstring
set objnoters=server.CreateObject("adodb.recordset")
set objnoters2=server.CreateObject("adodb.recordset")
ssql="select max(noteid) as maxid from notebook"
ssql2="select*from notebook"
userid=trim(request.form("userid"))
email=trim(request.form("email"))
content=trim(request.form("content"))
subject=trim(left(request.form("subject"),17))
application.Lock()
objnoters.open ssql,conn,1,3
if objnoters.eof or isnull(objnoters("maxid")) then
noteid="n00001"
else
temp=left(objnoters("maxid"),6)
temp=right(temp,5)
temp=cint(temp)
temp=cstr(temp+1)
for length=1 to 5-len(temp)
temp="0"&temp
next
noteid="n"&temp
end if
notetime=now()
insertstr="insert into notebook(noteid,subject,userid,notetime,content,readnum,email,status) values('"&noteid&"','"&subject&"','"&userid&"','"&notetime&"','"&content&"',0,'"&email&"',0);"
objnoters2.open insertstr,conn,1,3
application.UnLock()
objnoters.close
set objnoters=nothing
conn.close
set conn=nothing
%>
<html>
<head><title>留言成功</title></head><body>
<font style="font:10pt" color=#9900cc>留言成功,请
<a href="vbscript:window.close()">点击关闭!</a>或<a href="noteview.asp">查看留言</a></font>
</body>
</html>
2006-12-30 13:52
tang688
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1219
专家分:35
注 册:2004-12-25
收藏
得分:0 
下标越界意思是:你的字符长度不足5个,因为你要取5个.

2006-12-30 14:03
快速回复:[求助]类型不匹配: 'cint'
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018014 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved