请教高手这个难题?
时间:2010-10-09
来源:互联网
下面的sql有三种写法都报错,在and附近有语法错误,有谁能指出来吗?
age 是INT类型
VBScript code
age 是INT类型
VBScript code
response.CacheControl = "no-cache" response.AddHeader "pragma","no-cache" response.Expires=-1 dim sex,age1,age2,country,p,maxNum dim reStr sex=trim(request.QueryString("sex")) age1=request.QueryString("age1") age2=request.QueryString("age2") country=trim(request.QueryString("country")) p=trim(request.QueryString("p")) if isempty(p) or (not isNumeric(p)) then p=int(rnd()*100) p=int(p) if p>maxNum then p=maxNum set rs=server.createobject("adodb.recordset") 'sql="select top 1 id,uid,PICPATH from ladlady where [id] > " & p & " and uid IN(select uid,Gender, age,Country from customer1 where Gender='"&sex&"' and (age BETWEEN "&age1&" and "&age2&") and Country ='"&country&"') order by [id] asc" 'sql="select top 1 id,uid,PICPATH from ladlady where [id] > " & p & " and uid IN(select uid,Gender, age,Country from customer1 where Gender='"&sex&"' and ( age > "&age1&" and age < "&age2&") and Country ='"&country&"') order by [id] asc" sql="select top 1 id,uid,PICPATH from ladlady s,customer1 t where [id] > " & p & " and t.Gender='"&sex&"' and t.age > "&age1&" and t.age < "&age2&" and t.Country='"&country&"'" rs.open sql,conn,1,1 '......
作者: frankrenping 发布时间: 2010-10-09
maxNum没赋值啊
Response.Write sql
看是什么
Response.Write sql
看是什么
作者: net_lover 发布时间: 2010-10-09
引用 1 楼 net_lover 的回复:
maxNum没赋值啊
Response.Write sql
看是什么
maxNum没赋值啊
Response.Write sql
看是什么
应该是age1或者age2没有获取到值导致出错,输出sql语句看看是否语法错误
作者: showbo 发布时间: 2010-10-09
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28