关于数据查询中一个问题,请各位兄台指教。

jszhhy 2006-02-07 04:01:24
<%
Dim tjdw, cxyear,cxmonth,cxsql
cxsql = "select * from gdl "
tjdw = request.Form("cxbds")
cxyear = request.Form("cxyear")
cxmonth = request.Form("cxmonth")
cxsql = cxsql + "where bdzbh="+tjdw
cxsql = cxsql + " and year= "+cxyear+" and month= " +cxmonth
response.Write cxsql
%>

<%
Dim conn
Set Conn= Server.CreateObject("ADODB.Connection")
Conn.open="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("db\yxb.mdb")
%>
<%
Dim rs
set rs=server.CreateObject("ADODB.RecordSet")
rs.open cxsql,conn,1,1
%>

显示如下:
select * from gdl where bdzbh=3002 and year= 2006 and month= 1
Microsoft JET Database Engine 错误 '80040e10'

至少一个参数没有被指定值。

/xscx-1-2-1.asp,行20

说我rs.open cxsql,conn,1,1这一行有错误,不知什么原因请各位大师帮忙看看。
...全文
79 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
jszhhy 2006-02-07
  • 打赏
  • 举报
回复
知道了,谢谢。有什么好的调试工具吗,有时候都不知道错在哪里。就给了个HTTP 500 - 内部服务器错误
bblovepp 2006-02-07
  • 打赏
  • 举报
回复
year和month是默认关键字,建议以后设计表时不要直接使用数据库中敏感的词,可以设计成year_1,month_1
jszhhy 2006-02-07
  • 打赏
  • 举报
回复
可以了,能告诉我什么原因吗?
jszhhy 2006-02-07
  • 打赏
  • 举报
回复
兄台,好像还是不行阿。
  • 打赏
  • 举报
回复
select * from gdl where bdzbh=3002 and [year]= 2006 and [month]= 1
jszhhy 2006-02-07
  • 打赏
  • 举报
回复
year和month都是整形数据,从显示的这句select * from gdl where bdzbh=3002 and year= 2006 and month= 1 提示不是已经赋值了吗?
  • 打赏
  • 举报
回复
[year] [month]

28,406

社区成员

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

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