| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 442 人关注过本帖
标题:求助ASP问题
只看楼主 加入收藏
namezk3
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2012-4-3
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
求助ASP问题
先看一下代码,在运行的时候只要对rsE101("E101")有任何操作,比如加减乘除,或者CInt int等,都报错。另外曾经定义变量x,让他等于rsE101("E101")没有问题,但再对x进行操作就报错
错误信息
{Microsoft VBScript 运行时错误 错误 '800a000d'

类型不匹配

/index.asp,行 154 }
网页上能显示rsE101("E101"),显示的结果是54329,说明SQL查询语句没有问题。希望各位大侠能够帮忙解决一下,小弟先谢谢了。以下是页面的所有代码。

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>张昆每小时报数用</title>
</head>
<%
'以下是格式化时间
Function Format_Time(s_Time, n_Flag)
Dim y, m, d, h, mi, s
Format_Time = ""
If IsDate(s_Time) = False Then Exit Function
y = cstr(year(s_Time))
m = cstr(month(s_Time))
If len(m) = 1 Then m = "0" & m
d = cstr(day(s_Time))
If len(d) = 1 Then d = "0" & d
h = cstr(hour(s_Time))
If len(h) = 1 Then h = "0" & h
mi = cstr(minute(s_Time))
If len(mi) = 1 Then mi = "0" & mi
s = cstr(second(s_Time))
If len(s) = 1 Then s = "0" & s
select Case n_Flag
Case 1
    ' 日期格式化
    Format_Time ="'" & y & m & d & "'"
Case 2
    ' 十二点用的时间
    Format_Time ="'" & y & "." & m & "." & d & "-11:50:00'"
Case 3
    ' 十三点用的时间
    Format_Time ="'" & y & "." & m & "." & d & "-12:50:00'"
Case 4
    ' 十四点用的时间
    Format_Time ="'" & y & "." & m & "." & d & "-13:50:00'"
Case 5
    ' 十五点用的时间
    Format_Time ="'" & y & "." & m & "." & d & "-14:50:00'"
Case 6
    ' 十六点用的时间
    Format_Time ="'" & y & "." & m & "." & d & "-15:50:00'"
Case 7
    ' 十七点用的时间
    Format_Time ="'" & y & "." & m & "." & d & "-16:50:00'"
Case 8
    ' 十八点用的时间
    Format_Time ="'" & y & "." & m & "." & d & "-17:50:00'"
Case 9
    ' 十九点用的时间
    Format_Time ="'" & y & "." & m & "." & d & "-18:50:00'"
Case 10
    ' 二十点用的时间
    Format_Time ="'" & y & "." & m & "." & d & "-19:50:00'"
Case 11
    ' 二十一点用的时间
    Format_Time ="'" & y & "." & m & "." & d & "-20:50:00'"
Case 12
    ' 二十一点用的时间
    Format_Time ="'" & y & "." & m & "." & d & "-21:50:00'"
End select
End Function
'以上格式化时间结束

daye=Format_Time(now,1)
sj12=Format_Time(now,2)
sj13=Format_Time(now,3)
sj14=Format_Time(now,4)
sj15=Format_Time(now,5)
sj16=Format_Time(now,6)
sj17=Format_Time(now,7)
sj18=Format_Time(now,8)
sj19=Format_Time(now,9)
sj20=Format_Time(now,10)
sj21=Format_Time(now,11)
sjjy=Format_Time(now,12)
response.write  "今天是" & daye & "日"

%>
<%'链接sybase1数据库
set conn=server.createobject("adodb.connection")
conn.open "driver={SQL Server};database=sybase1;Server=MISSERVER2;uid=sy;pwd=sypass;"
%>
<%'链接sybase2数据库
set con2=server.createobject("adodb.connection")
con2.open "driver={SQL Server};database=sybase2;Server=MISSERVER2;uid=sy;pwd=sypass;"
%>
<%
'百货商场一套11:50前销售
execE101="select isnull(SUM(F_HJJE),0) as E101 from sy0019999.PBILL1101 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE102="select isnull(SUM(F_HJJE),0) as E102 from sy0019999.PBILL1102 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE103="select isnull(SUM(F_HJJE),0) as E102 from sy0019999.PBILL1103 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE104="select isnull(SUM(F_HJJE),0) as E104 from sy0019999.PBILL1104 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE105="select isnull(SUM(F_HJJE),0) as E105 from sy0019999.PBILL1105 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE106="select isnull(SUM(F_HJJE),0) as E106 from sy0019999.PBILL1106 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE201="select isnull(SUM(F_HJJE),0) as E201 from sy0019999.PBILL1201 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE202="select isnull(SUM(F_HJJE),0) as E202 from sy0019999.PBILL1202 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE203="select isnull(SUM(F_HJJE),0) as E202 from sy0019999.PBILL1203 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE204="select isnull(SUM(F_HJJE),0) as E204 from sy0019999.PBILL1204 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE205="select isnull(SUM(F_HJJE),0) as E205 from sy0019999.PBILL1205 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE301="select isnull(SUM(F_HJJE),0) as E301 from sy0019999.PBILL1301 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE302="select isnull(SUM(F_HJJE),0) as E302 from sy0019999.PBILL1302 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE303="select isnull(SUM(F_HJJE),0) as E302 from sy0019999.PBILL1303 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE304="select isnull(SUM(F_HJJE),0) as E304 from sy0019999.PBILL1304 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
'execE305="select isnull(SUM(F_HJJE),0) as E305 from sy0019999.PBILL1305 where F_BM<21 AND F_BM>11 AND F_YWRQ=" & daye & "and F_SJ<" & sj12
set rsE101=server.createobject("adodb.recordset")
'set rsE102=server.createobject("adodb.recordset")
'set rsE103=server.createobject("adodb.recordset")
'set rsE104=server.createobject("adodb.recordset")
'set rsE105=server.createobject("adodb.recordset")
'set rsE106=server.createobject("adodb.recordset")
'set rsE201=server.createobject("adodb.recordset")
'set rsE202=server.createobject("adodb.recordset")
'set rsE203=server.createobject("adodb.recordset")
'set rsE204=server.createobject("adodb.recordset")
'set rsE205=server.createobject("adodb.recordset")
'set rsE301=server.createobject("adodb.recordset")
'set rsE302=server.createobject("adodb.recordset")
'set rsE303=server.createobject("adodb.recordset")
'set rsE304=server.createobject("adodb.recordset")
'set rsE305=server.createobject("adodb.recordset")
rsE101.open execE101,conn,1,1
'rsE102.open execE102,conn,1,1
'rsE103.open execE103,conn,1,1
'rsE104.open execE104,conn,1,1
'rsE105.open execE105,conn,1,1
'rsE106.open execE106,conn,1,1
'rsE201.open execE201,conn,1,1
'rsE202.open execE202,conn,1,1
'rsE203.open execE203,conn,1,1
'rsE204.open execE204,conn,1,1
'rsE205.open execE205,conn,1,1
'rsE301.open execE301,conn,1,1
'rsE302.open execE302,conn,1,1
'rsE303.open execE303,conn,1,1
'rsE304.open execE304,conn,1,1
'rsE305.open execE305,conn,1,1
%>
<body>
<p>
</p>
<p><% response.write sj12 & "销售" %></p>
<table width="50%" border="1" cellspacing="2" cellpadding="2">
  <tr>
    <td>&nbsp;</td>
    <td>百货</td>
    <td>女服</td>
    <td>男服</td>
    <td>合计</td>
  </tr>
  
  <tr>
    <td>一套</td>
    <td><% =rsE101("E101") %></td>
    <td><% =rsE101("E101") + 2 %></td>
    <td></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>二套</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>总计</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>
搜索更多相关主题的帖子: html 加减乘除 Microsoft content title 
2012-04-03 17:56
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:20 
是不是整型太小,尝试转换为浮点型或双精度浮点型呢?
2012-04-04 09:54
快速回复:求助ASP问题
数据加载中...
 
   



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

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