asp操作:通过查询判断access数据库中一个表的数据,进而又通过另个表来进行查询判断
时间:2011-10-13
来源:互联网
<%
dim str '公告引用
dim gonggao_sy '公告引导
gonggao_sy=1
str="系统暂无公告!"
set rs=server.CreateObject("adodb.recordset")
sql1="select top 1 * from kongzhi where sy="&n&" order by id desc"
rs.open sq1,conn,1,3
if not rs.eof then
if rs("gonggao_kongzhi")=1 then
session("gonggao")="系统暂无公告" 'gonggao 用来传递公告显示的东西
conn.close
set conn=nothing
else
set rs2=server.CreateObject("adodb.recordset")
sql2="select top 1 * from gonggao where sy="&gonggao_sy&" order by id desc"
rs2.open sql2,conn,1,3
if not rs2.eof then
session("gonggao")=rs("notice")
end if
end if
end if
%>
如果是这样运行,则得到的结果:ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
请问这是什么原因?还有那个session(“gonggao”)的传递可以吗?
谢谢各位?
dim str '公告引用
dim gonggao_sy '公告引导
gonggao_sy=1
str="系统暂无公告!"
set rs=server.CreateObject("adodb.recordset")
sql1="select top 1 * from kongzhi where sy="&n&" order by id desc"
rs.open sq1,conn,1,3
if not rs.eof then
if rs("gonggao_kongzhi")=1 then
session("gonggao")="系统暂无公告" 'gonggao 用来传递公告显示的东西
conn.close
set conn=nothing
else
set rs2=server.CreateObject("adodb.recordset")
sql2="select top 1 * from gonggao where sy="&gonggao_sy&" order by id desc"
rs2.open sql2,conn,1,3
if not rs2.eof then
session("gonggao")=rs("notice")
end if
end if
end if
%>
如果是这样运行,则得到的结果:ADODB.Recordset (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
请问这是什么原因?还有那个session(“gonggao”)的传递可以吗?
谢谢各位?
作者: cyn336 发布时间: 2011-10-13
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
这个应该是你某个变量参数没有定义或者类型不对造成的
这个应该是你某个变量参数没有定义或者类型不对造成的
作者: chinmo 发布时间: 2011-10-14
gonggao_sy有值没有?
作者: dogfish 发布时间: 2011-10-14
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28