| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 446 人关注过本帖
标题:请教这个语句错误在哪里??
只看楼主 加入收藏
bccnlqr
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-3-25
收藏
 问题点数:0 回复次数:3 
请教这个语句错误在哪里??
我网站一个asp文件中,包含以下语句,打开是提示
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 'dongtai<6 and id=' 中

原文件语句:

dongtai<6 and id="&session("id")&"

谢谢。。

[此贴子已经被作者于2006-4-12 13:42:14编辑过]

搜索更多相关主题的帖子: 语句 
2006-04-12 13:41
lanya1983
Rank: 1
等 级:新手上路
帖 子:96
专家分:0
注 册:2006-3-11
收藏
得分:0 

在把上下的代码写的全一些大家看看啊


我的网站http:\\\\lanya. http:\\\\leilei. 主要是练练手
2006-04-12 13:44
bccnlqr
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-3-25
收藏
得分:0 

<%dim dongtai,namekey
namekey=trim(request("namekey"))
dongtai=trim(request("dongtai"))
if dongtai="" then dongtai=request.QueryString("dongtai")
if namekey="" then namekey=request.querystring("namekey")
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td valign="top">
<%'开始分页
Const MaxPerPage=12
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
set rs=server.CreateObject("adodb.recordset")
if namekey="" then
'//按状态查询
if dongtai=0 or dongtai="" then
select case dongtai
case "0"
rs.open "select distinct(dingdan),userid,userzhenshiname,actiondate,songhuofangshi,zhifufangshi,dongtai from shop_action where dongtai<6 and id="&session("id")&" order by actiondate desc",conn,1,1
case ""
rs.open "select distinct(dingdan),userid,userzhenshiname,actiondate,songhuofangshi,zhifufangshi,dongtai from shop_action where dongtai<6 and id="&session("id")&" order by actiondate desc",conn,1,1
end select
else
rs.open "select distinct(dingdan),userid,userzhenshiname,actiondate,songhuofangshi,zhifufangshi,dongtai from shop_action where dongtai="&dongtai&" and id="&session("id")&" order by actiondate",conn,1,1
end if
else
'//按用户查询
if dongtai=0 or dongtai="" then
rs.open "select distinct(dingdan),userid,userzhenshiname,actiondate,songhuofangshi,zhifufangshi,dongtai from shop_action where dongtai<6 and username='"&namekey&"' and id="&session("id")&" order by actiondate desc",conn,1,1
else
rs.open "select distinct(dingdan),userid,userzhenshiname,actiondate,songhuofangshi,zhifufangshi,dongtai from shop_action where dongtai="&dongtai&" and username='"&namekey&"' and id="&session("id")&" order by actiondate",conn,1,1
end if
end if

if err.number<>0 then
response.write "数据库中无数据"
end if

if rs.eof And rs.bof then
Response.Write "<p align='center' class='contents'> 对不起,您选择的状态目前还没有订单!</p>"
else
totalPut=rs.recordcount

if currentpage<1 then
currentpage=1
end if

if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if

if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"shjia.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"shjia.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"shjia.asp"
end if
end if
end if

sub showContent
dim i
i=0

%>

[此贴子已经被作者于2006-4-12 13:58:59编辑过]

2006-04-12 13:55
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
session("id")没有值
2006-04-12 14:36
快速回复:请教这个语句错误在哪里??
数据加载中...
 
   



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

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