菜鸟提问

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
这段程序如果要缩写应该怎么弄,这样老是打开同一个数据库太麻烦了
...全文
9 点赞 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
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
回复
相关推荐
发帖
MS-SQL Server
创建于2007-09-28

3.3w+

社区成员

MS-SQL Server相关内容讨论专区
申请成为版主
帖子事件
创建了帖子
2003-05-13 08:00
社区公告
暂无公告