菜鸟提问

82417 2003-05-13 08:00:24
rs.open "Select top 1 * From shop_sp where id="&cr_id&"",conn,1,3
rs("seller")=cartseller
rs.close
set rs=nothing
set rs=server.CreateObject("adodb.recordset")
rs.open "Select top 1 * From shop_sp where id="&spid&"",conn,1,3
if rs("seller")<>cartseller then ....
end if
rs.close
set rs=nothing
这段程序如果要缩写应该怎么弄,这样老是打开同一个数据库太麻烦了
...全文
39 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
pengdali 2003-05-13
  • 打赏
  • 举报
回复
rs.open "Select top 1 * From shop_sp where id="&cr_id&"",conn,1,3


rs("seller")=cartseller


rs.close


rs.open "Select top 1 * From shop_sp where id="&spid&"",conn,1,3

if rs("seller")<>cartseller then ....

end if

rs.close

set rs=nothing
HawaiiLeo 2003-05-13
  • 打赏
  • 举报
回复
sql = "Select top 1 * From shop_sp where id="&cr_id
rs.open sql,conn,1,3
rs("seller")=cartseller
rs.close

sql = "Select top 1 * From shop_sp where id="&spid
rs.open sql,conn,1,3
if rs("seller")<>cartseller then ....
end if
rs.close
set rs=nothing

34,873

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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