求助:rs.recordcount 返回值为 -1,怎么回事?

zuida 2006-12-02 09:15:03

……
set rs=conn.execute("select gsname from tcinfor where gsname='"&gsname&"'")
if rs.recordcount>0 then
set rs=nothing
response.Write "<script language=JavaScript>{window.alert('同一记录不能重复添加!');window.location.href='admin_writeto.asp';}</script>"
response.End()
end if
set rs=nothing
……

我调试了好几次都没成功,好来发现 rs.recordcount返回值每次都是-1,这是怎么回事呢?
...全文
132 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
zuida 2006-12-02
  • 打赏
  • 举报
回复
成功了,DieGhost(☆小过) 正解,非常感谢!~
DieGhost 2006-12-02
  • 打赏
  • 举报
回复
Mapleleaf123() ( ) 信誉:100 Blog 2006-12-02 09:58:49 得分: 0


set rs=conn.execute...不支持recordcount

set rs = Server.CreateObject("adodb.recordset")


-----------------------------------------------
汗~~~~~~~~~~~~~~~~~
Mapleleaf123 2006-12-02
  • 打赏
  • 举报
回复
贴多点代码出来看看

-------------------

set rs = Server.CreateObject("adodb.recordset")
rs.open "select gsname from tcinfor where gsname='"&gsname&"'",conn,1,1

zuida 2006-12-02
  • 打赏
  • 举报
回复
还是不行,我成 set rs = Server.CreateObject("adodb.recordset")…… 这种方式了,还是返回-1
DieGhost 2006-12-02
  • 打赏
  • 举报
回复
conn.CursorLocation=3
set rs=conn.execute("select gsname from tcinfor where gsname='"&gsname&"'")
if rs.recordcount>0 then
...
chenguang79 2006-12-02
  • 打赏
  • 举报
回复
set rs = Server.CreateObject("adodb.recordset")
strsql = "select gsname from tcinfor where gsname='"&gsname&"'"
rs.open strsql conn 2,3
Mapleleaf123 2006-12-02
  • 打赏
  • 举报
回复
set rs=conn.execute...不支持recordcount

set rs = Server.CreateObject("adodb.recordset")
zuida 2006-12-02
  • 打赏
  • 举报
回复
自己顶一下,大家帮帮我吧!~

28,390

社区成员

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

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