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

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 行
...全文
78 点赞 收藏 6
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
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
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2004-11-29 04:42
社区公告
暂无公告