关于SUB多次调用的问题

来源:百度知道 编辑:UC知道 时间:2024/05/22 02:14:58
下面程序我用<% call Content2() %>
就可以使用,但问题是我想查询不同的商品.如
sql99="select top 4 * from Product where Elite=true order by ArticleID desc"
但我想调用不同的查询条件.如改为
sql99="select top 4 * from Product where Elite='猪肉' order by ArticleID desc"

高手们用<% call Content2(参数,怎么写) %>

过程.....
sub Content2()
set rs99=server.CreateObject("adodb.recordset")
sql99="select top 4 * from Product where Elite=true order by ArticleID desc"
rs99.open sql99,conn,1,1
strTemp2=""

a=0
do while not rs99.eof

strTemp2=strTemp2 & "<td width=24% height=125>"
strTemp2=strTemp2 & "<div>"
strTemp2=strTemp2 & "<table border=0 cellpadding=0 cellspacing=1 bgcolor=#ffffff>"
strTemp2=strTemp2 & "<tr>"
strTemp2=strTemp2 & "<td width=167 bgcolor=#FFFFFF>"
strTemp2=strTemp2 & &q

sub Content2(arg)
set rs99=server.CreateObject("adodb.recordset")
sql99="select top 4 * from Product where Elite='"&arg&"' order by ArticleID desc"
rs99.open sql99,conn,1,1
strTemp2=""

a=0
do while not rs99.eof

strTemp2=strTemp2 & "<td width=24% height=125>"
strTemp2=strTemp2 & "<div>"
strTemp2=strTemp2 & "<table border=0 cellpadding=0 cellspacing=1 bgcolor=#ffffff>"
strTemp2=strTemp2 & "<tr>"
strTemp2=strTemp2 & "<td width=167 bgcolor=#FFFFFF>"
strTemp2=strTemp2 & "<div align=center><a href=product_view.asp?articleid="&rs99("ArticleID")&" target=_blank><img src="&rs99("DefaultPicUrl") &" width=166 height=166 border=0></a></div></td>"
strTemp2=strTemp2 & "</tr>"