数据库操作???????????????????????????????????????????????????????????????????????????????

jack9527 2004-11-29 04:42:33
set conn=server.CreateObject("adodb.connection")
conn.open(MM_Conn_String)
if ordx<>"" then
sql="select * from workrep where recdate>"&datex&" and username='"&username&"' order by '"&ordx&"' desc"
else
sql="select * from workrep where recdate>"&datex&" and username='"&username&"' order by id desc"
end if
set rsxx=server.CreateObject("adodb.recordset")
rsxx.open sql,conn,1,1
end if
报错:

错误类型:
Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配: 'rsxx'
/oa1/repselect.asp, 第 88 行
...全文
113 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
jack9527 2004-11-29
  • 打赏
  • 举报
回复
lienzhu(李强) 正解,谢谢
lienzhu 2004-11-29
  • 打赏
  • 举报
回复
把你的sql语句输出来

字符串型:两边要加单引号
日期类型:access数据库是两边加“#”;sql server数据库两边加单引号
liuyangxuan 2004-11-29
  • 打赏
  • 举报
回复
sql="select * from workrep where recdate>"&datex&" and username='"&username&"' order by '"&ordx&"' desc"


'"&ordx&"' 按字符型排序?如果是文本型不用单引号。
wangjinmin1982 2004-11-29
  • 打赏
  • 举报
回复
Microsoft VBScript 运行时错误 (0x800A000D) --> 错误引用rs变量(rs对像已关闭或未定义)
jack9527 2004-11-29
  • 打赏
  • 举报
回复
..................
jack9527 2004-11-29
  • 打赏
  • 举报
回复
if request.Form("sure")="sure" then
datex=request.Form("repdate")
autor=request.Form("username")
ordx=""
ordx=trim(request.QueryString("ord"))
set conn=server.CreateObject("adodb.connection")
conn.open(MM_Conn_String)
if ordx<>"" then
sql="select * from workrep where recdate>"&datex&" and username='"&username&"' order by '"&ordx&"' desc"
else
sql="select * from workrep where recdate>"&datex&" and username='"&username&"' order by id desc"
end if
set rsxx=server.CreateObject("adodb.recordset")
rsxx.open sql,conn,1,1
end if

28,390

社区成员

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

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