ACCESS和SQL数据库查询有和不同?

makay 2003-08-22 11:45:15
我做好一个网页,用的是SQL数据库,现移到ACCESS上来,在SQL数据库上运行好好的,可一移到ACCESS就出了问题,请看下面:

地址栏:http://leo/type_show2.asp?l_type=国画&auditing=2

错误类型:
Microsoft JET Database Engine (0x80040E10)
/type_show2.asp, 第 157 行

错误信息:
至少一个参数没有被指定值。

下面从150行开始一直往下:
if M_type="" then
sql="select * from artinfo where L_type= '"&request("L_type")&"' and auditing= '"&request("auditing")&"' order by id desc"
elseif M_type<>"" then
sql="select * from artinfo where L_type='"&request("L_type")&"' and M_type='" &request("M_type") & "'"
else
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.write "<p align=center>还 没 有 任 何 作 品</p>"

错误停在这句上:rs.open sql,conn,1,3 ,

另外下面二句有何不同?
"select * from artinfo where id='"&request("id")&"'"
"select * from artinfo where id="&request("id")
id的数据类型是数字.
ACCESS和SQL数据库查询不一样吗?
...全文
97 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
dufu 2003-08-23
  • 打赏
  • 举报
回复
检查转移到access后id字段的数据类型,如果是数字型,如int那应该用第二句,如果是字符型用第一句。
gboy2003 2003-08-23
  • 打赏
  • 举报
回复
up
makay 2003-08-23
  • 打赏
  • 举报
回复
解决了,类型问题,用SQL的导出数据,类型就会出点小错,唉,结贴。
coffee_cn 2003-08-23
  • 打赏
  • 举报
回复
打印你的sql语句,看看有没有问题,
或者直接把打印的sql语句放到access的查询里面执行看看错误在什么地方
yyy431706 2003-08-23
  • 打赏
  • 举报
回复
如果数据类型没错的话,你用response.write 语句将request("L_type")、request("auditing")、request("M_type") 这三个变量输出,看是否为空,我想应该是这个问题
makay 2003-08-23
  • 打赏
  • 举报
回复
上面字符类型的我试过了,可还是出错

下面从150行开始一直往下:
if M_type="" then
sql="select * from artinfo where L_type= '"&request("L_type")&"' and auditing= "&request("auditing")&" order by id desc"
elseif M_type<>"" then
sql="select * from artinfo where L_type='"&request("L_type")&"' and M_type='" &request("M_type") & "'"
else
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.write "<p align=center>还 没 有 任 何 作 品</p>"

错误停在这句上:rs.open sql,conn,1,3 ,

错误类型:
Microsoft JET Database Engine (0x80040E10)
/type_show2.asp, 第 157 行

错误信息:
至少一个参数没有被指定值。

l_type和m_type是字符型,auditing是数字,上面的错误信息好像不是因SQL这句造的,大家帮忙看看,急。。。

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧