| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1600 人关注过本帖
标题:表达工出错?
只看楼主 加入收藏
中国男孩
Rank: 1
等 级:新手上路
帖 子:291
专家分:7
注 册:2006-3-19
结帖率:0
收藏
 问题点数:0 回复次数:25 
表达工出错?


先首,祝各位大侠们<中秋节快乐>!
不知道我的这个程序出错,出错在哪里,请大侠们帮小弟解决:
出错信息如下:
Microsoft JET Database Engine '80040e14'

语法错误 (操作符丢失) 在查询表达式 '>=clng('') and <=clng('')' 中。

\wwwroot\cw\searh.asp, line 10

--------------------------------------------------------------------------------
Host by NetBox Version 2.8 Build 4128


原程序如果下:

<!--#Include File="linkdatamdb.asp"-->
<%

select1=request.querystring("select1")
t1=request.querystring("t1")
t2=request.querystring("t2")

set cwrs=server.createobject("ADODB.Recordset")
cwsql="select * from cw_data where "&select1&">=clng('"&t1&"') and "&select1&"<=clng('"&t2&"') Order By id asc"
cwrs.open cwsql,cwconn,1,1
if cwrs.recordcount<1 then
Response.Write "<script language=javascript>alert('对不起,没有找到你要找的内容!');self.location=(""show_data.asp"");</script>"
else

If Request.Querystring("dch_page")="" then
dch_page=1
Else
dch_page=clng(Request.Querystring("dch_page"))
End If
Cwrs.Pagesize=1
Cwrs.AbsolutePage=dch_page

%>
<tr>
<td>
<table border="0" width="100%" id="table4" style="border-collapse: collapse" bgcolor="#0066FF" cellpadding="0">
<tr>
<td>
<table border="1" width="100%" style="border-collapse: collapse" id="table5" height="26" bordercolor="#FFFFFF">
<tr>
<td width="82" align="center">进价</td>
<td width="93" align="center">出售价</td>
<td width="93" align="center">利润</td>
<td align="center">时间</td>
<td width="144" align="center">拿货地址</td>
<td width="192" align="center">注备</td>
</tr>
</table>
</td>
</tr>


<tr>
<td>
<table border="1" width="100%" style="border-collapse: collapse" id="table6" bordercolor="#FFFFFF">
<%for cw=1 to cwrs.pagesize
if cwrs.bof or cwrs.eof then exit for
%>
<tr>
<td width="82">
<p align="right"><b><font size="2"><%=cwrs("jj")%>¥</font></b></td>
<td width="93">
<p align="right"><b><font size="2"><%=cwrs("csj")%>¥</font></b></td>
<td width="93">
<p align="right"><b><font size="2"><%=cwrs("ly")%>¥</font></b></td>
<td width="135"><%=cwrs("year")%><%=cwrs("month")%><%=cwrs("day")%></td>
<form method="POST" action="">
<td>
<p align="center">
<textarea rows="1" name="S1" cols="13" style="border: 1px solid #0066FF; padding: 0; background-color:#0066FF"><%=cwrs("hour")%><%=cwrs("address")%></textarea></td>
<td width="192">
<p align="center">
<textarea rows="1" name="S2" cols="18" style="border: 1px solid #0066FF; background-color:#0066FF; padding-left:1px; padding-right:0; padding-top:0; padding-bottom:0"><%=cwrs("bz")%></textarea></td>
</form>
</tr>
<%
cwrs.movenext
next
end if
%>

</table>
</td>
</tr>
</table>
<p align="center">
<%
For zqy=1 To cwrs.PageCount
If zqy=dch_Page Then
Response.Write zqy &"&nbsp"
Else
Response.Write "<a href='searh.asp?dch_Page="&zqy&"'>"&zqy&"</a>" &"&nbsp"

End if
Next
%>
<select size="1" name="select" onchange="javascript:location=this.options[this.selectedIndex].value;">
<option value="第<%=dch_page%>页">第<%=dch_page%>页</option>
<%
for dch=1 to cwrs.pagecount
if dch<>dch_page then
%>
<option value=searh.asp?dch_page="<%=dch%>">第<%=dch%>页</option>
<%
end if
next
%>

</select> </p>
</td>
</tr>
<%
cwconn.close
set cwconn=nothing
%>

0tKyabo0.rar (32.48 KB) 表达工出错?


搜索更多相关主题的帖子: Microsoft 中秋节 clng 表达 操作符 
2007-09-25 13:46
hmhz
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:30
帖 子:1890
专家分:503
注 册:2006-12-17
收藏
得分:0 

where "&select1&">=clng("&t1&") and "&select1&"<=clng("&t2&")

[此贴子已经被作者于2007-9-25 13:59:05编辑过]


[编程论坛] ASP超级群:49158383  敲门暗号:ASP编程
龍艺博客 http://www.
2007-09-25 13:52
中国男孩
Rank: 1
等 级:新手上路
帖 子:291
专家分:7
注 册:2006-3-19
收藏
得分:0 
怎么改呢?

我很想把计算机学好!!
2007-09-25 14:03
中国男孩
Rank: 1
等 级:新手上路
帖 子:291
专家分:7
注 册:2006-3-19
收藏
得分:0 

请问大侠怎么解决呢?


我很想把计算机学好!!
2007-09-25 14:05
hmhz
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:30
帖 子:1890
专家分:503
注 册:2006-12-17
收藏
得分:0 
帮你改好了
where "&select1&">=clng("&t1&") and "&select1&"<=clng("&t2&")

[编程论坛] ASP超级群:49158383  敲门暗号:ASP编程
龍艺博客 http://www.
2007-09-25 14:07
中国男孩
Rank: 1
等 级:新手上路
帖 子:291
专家分:7
注 册:2006-3-19
收藏
得分:0 
但是还是没对啊

我很想把计算机学好!!
2007-09-25 14:08
中国男孩
Rank: 1
等 级:新手上路
帖 子:291
专家分:7
注 册:2006-3-19
收藏
得分:0 

我按你的方法去做了:
但还是出现了这个的信息:
Microsoft JET Database Engine '80040e14'

语法错误 (操作符丢失) 在查询表达式 '>=clng() and <=clng()' 中。

\wwwroot\cw\searh.asp, line 10


我很想把计算机学好!!
2007-09-25 14:10
tianyu123
Rank: 1
等 级:新手上路
威 望:2
帖 子:576
专家分:0
注 册:2007-8-26
收藏
得分:0 


t1=request.querystring("t1")

t2=request.querystring("t2")

t1,t2可能取值为空或不是数字!

建议在此两句下面,加入语句检测一下:

t1=request.querystring("t1")

t2=request.querystring("t2")

response.write t1&t2

response.end

看输出的值是否为空或者是否是数字!


改变一切,须从改变观念开始!
2007-09-25 15:22
中国男孩
Rank: 1
等 级:新手上路
帖 子:291
专家分:7
注 册:2006-3-19
收藏
得分:0 

大侠你好,我已经照你的方法,去做,向页面输出的是:数字:123
123123


我很想把计算机学好!!
2007-09-25 15:29
中国男孩
Rank: 1
等 级:新手上路
帖 子:291
专家分:7
注 册:2006-3-19
收藏
得分:0 
大侠,你可以下载我的源程序去看一下,

我很想把计算机学好!!
2007-09-25 15:30
快速回复:表达工出错?
数据加载中...
 
   



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

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