+ -
当前位置:首页 → 问答吧 → asp操作:通过查询判断access数据库中一个表的数据,进而又通过另个表来进行查询判断

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”)的传递可以吗? 
谢谢各位?

作者: cyn336   发布时间: 2011-10-13

参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
这个应该是你某个变量参数没有定义或者类型不对造成的

作者: chinmo   发布时间: 2011-10-14

gonggao_sy有值没有?

作者: dogfish   发布时间: 2011-10-14