| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4923 人关注过本帖
标题:[求助]类型不匹配: 'cint'
取消只看楼主 加入收藏
chengxiaobo
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2006-11-15
收藏
 问题点数:0 回复次数:8 
[求助]类型不匹配: '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
chengxiaobo
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2006-11-15
收藏
得分:0 
那你说我这个要怎么改啊,我不知道怎么改啊,我这个程序是在书上弄下来的,运行了一下,就有这样的一个错误,里面还有的程序我都有点看不懂,所以啊,就不知道我该怎么改了,你帮我改改了,告诉我要在那里改了,怎么改。
2006-12-29 16:24
chengxiaobo
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2006-11-15
收藏
得分:0 
我按你的意思写上去了了,有结果的,但是有一个问题,那就是我那个序号啊,只有n,没有后面的数字,我的设置是这样的我那个序号设置了是从n00001开始的,到现在了呢,在页面是显示的只有n而没有数字啊,这是为什么啊。
2006-12-30 12:57
chengxiaobo
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2006-11-15
收藏
得分:0 
写入数据库的程序没问题啊,我调试了,可以啊,没事啊,我不是跟你说了吗,我的那个值是从n00001开始的,我问了别人,他们说cint不能调出非数字,我看了一下数据库,它能写入的,里面存了东西的,呵呵,那你说是怎么弄的啊,要不我把那个n删了,看可以不。要不我把那个写入数据库的程序发到这里,你看呢。
2006-12-30 13:20
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
chengxiaobo
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2006-11-15
收藏
得分:0 
不对啊,我看了一下数据库啊,我里面的字符是n01001啊,这样取怎么会没有五个了呢,不会的啊。
2006-12-30 14:11
chengxiaobo
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2006-11-15
收藏
得分:0 
啊,我改了啊,我按你说的改了,仍然是说下标越界,仍然是那个问题,这现在要怎么办啊,晕死我了,我看了一下,觉得没有什么错啊。
2006-12-31 12:39
chengxiaobo
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2006-11-15
收藏
得分:0 
还有啊,有一点我忘了说,就是如果我只运行那个查看留言的那个代码了呢,它中显示这样的:留言已删除,请关闭,也就是说了呢它好像检测不到数据库里有数据了,它执行不了下面的代码。

[此贴子已经被作者于2006-12-31 13:07:28编辑过]


2006-12-31 13:05
chengxiaobo
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2006-11-15
收藏
得分:0 
呵呵,我啊,在这里乱改,还不小心被我改对了,现在可以了,但是呢,我还是有点弄不懂,这是为什么,你能帮我解释一下吗。我那个语句是这样的:temp=split(objnoters("notetime")," ",-1,1)
datetemp=split(temp(0),"-",-1,1)
notetime=datetemp(0)&"年"&datetemp(1)&"月"&datetemp(2)&"日"
timetemp=split(temp(2),":",-1,1)
notetime=notetime&timetemp(0)&"点"&timetemp(1)&"分"&timetemp(2)&"秒"
我呢,开始按照书上的,弄了一下,书上是timetemp=split(temp(1),":",-1,1),我就试了一下,把它改成了2,没想到就可以了,这是为什么,那里面的1,2,0是什么意思,如果呢,我把前面的0换成其它的就不可以了.还有就是split里的-1,和1是什么意思。望你能帮我解决一下。还有就是如果我仍然直接运行这个页面了呢,它中显示留言已删除,请关闭,这是为什么。
2006-12-31 13:57
快速回复:[求助]类型不匹配: 'cint'
数据加载中...
 
   



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

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