可以在SQL的属性中右键,给SQL设置它最大占用多大内存,一般地,如果服务器只是用作MSSQL服务器,建议只给 *** 作系统预留1G的内存,其它都分配给MSSQL使用。
看看我的这段代码,在每次循环的时候根据回复作者查询USER表然后直接输出就OK了.仔细看我的输出图片效果:
<%
set user=server.CreateObject ("adodb.recordset")
sql="select * from zf_user where usernemu='"&rs("zz")&"'"
user.open sql,conn,1,1
%>
<table width="156" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="21" colspan="2" ><div align="left">昵称:<%=user("usernemu")%></div></td>
</tr>
<tr>
<td colspan="2"><div align="left"><img src="<%if user("img")<>"" then response.write user("img") else response.write user("tx") end if%>" width="150" height="130"></div></td>
</tr>
<tr>
<td width="39" height="20">门派:</td>
<td width="111"><div align="left"> <font color="red"><%=user("mp")%></font> </div></td>
</tr>
<tr>
<td height="20">级别:</td>
<td><div align="left">
<%
if user("jf")<=200 then
response.write("<font color='red'>新手上路</font>")
elseif user("jf")<=500 then
response.write ("<font color='red'>一级会员</font><img src='imges/star_level1.gif'>")
elseif user("jf")<=1000 then
response.write ("<font color='red'>二级会员</font><img src='imges/star_level1.gif'><img src='imges/star_level1.gif'>")
elseif user("jf")<=1500 then
response.write ("<font color='red'>三级会员</font><img src='imges/star_level2.gif'><img src='imges/star_level1.gif'>")
elseif user("jf")>=3000 then
response.write ("<font color='red'>四级会员</font><img src='imges/star_level2.gif'><img src='imges/star_level2.gif'>")
end if%>
</div></td>
</tr>
<tr>
<td height="20">帖子:</td>
<td><div align="left">
<%if user("tz")=0 then response.write("该用户还没发帖")else response.write (""&user("tz")&" 篇")%>
</div></td>
</tr>
<tr>
<td height="20">经验:</td>
<td><div align="left"> <%=user("jy")%></div></td>
</tr>
<tr>
<td height="20">金币:</td>
<td>
<div align="left">
<%
set yin=server.CreateObject ("adodb.recordset")
sql="select * from zf_yinhang where usernemu='"&user("usernemu")&"'"
yin.open sql,conn,1,1
n=yin("zonge")
response.write n
yin.close
set yin=nothing
%>
</div></td>
</tr>
<tr>
<td height="20" colspan="2"><div align="left">注册时间:<%=user("rq")%></div></td>
</tr>
<tr>
<td height="20" colspan="2"><div align="center">加为好友 | 发短信息 </div></td>
</tr>
</table>
<%
user.close
set user=nothing
%>
</div></td>
<td width="548" valign="top"><div align="left">
<%call br()%>
<%=rs("content")%> </div></td>
</tr>
</table>
<%
set hf=server.CreateObject ("adodb.recordset")
sql="select * from zf_tiezi where zhuti='"&rs("zhuti")&"'"
hf.open sql,conn,1,1
if not hf.eof then
hf.pagesize=15
zongye=hf.pagecount
page=int(request("page"))
if page<=0 then page=1
if request("page")="" then page=1
hf.absolutepage=page
d=1
for i=1 to hf.pagesize
%>
<%call br()%>
<table width="736" border="1" cellpadding="0" cellspacing="0" bordercolor="#8DCB75" class="biankuang">
<tr bgcolor="#87D83F">
<td height="28" colspan="2"><div align="left">&nbsp&nbsp【 第<strong><%=d%></strong>楼 】发表于:<%=hf("rq")%></div></td>
</tr>
<tr>
<td width="169" valign="top"><div align="center">
<div align="center">
<%call br()%>
<%
set user=server.CreateObject ("adodb.recordset")
sql="select * from zf_user where usernemu='"& hf("zz") &"'"
user.open sql,conn,1,1
%>
<table width="156" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="21" colspan="2" ><div align="left">昵称:<%=user("usernemu")%></div></td>
</tr>
<tr>
<td colspan="2"><div align="left"><img src="<%if user("img")<>"" then response.write user("img") else response.write user("tx") end if%>" width="150" height="130"></div></td>
</tr>
<tr>
<td width="39" height="20">门派:</td>
<td width="111"><div align="left"> <font color="red"><%=user("mp")%></font> </div></td>
</tr>
<tr>
<td height="20">级别:</td>
<td><div align="left">
<%
if user("jf")<=200 then
response.write("<font color='red'>新手上路</font>")
elseif user("jf")<=500 then
response.write ("<font color='red'>一级会员</font><img src='imges/star_level1.gif'>")
elseif user("jf")<=1000 then
response.write ("<font color='red'>二级会员</font><img src='imges/star_level1.gif'><img src='imges/star_level1.gif'>")
elseif user("jf")<=1500 then
response.write ("<font color='red'>三级会员</font><img src='imges/star_level2.gif'><img src='imges/star_level1.gif'>")
elseif user("jf")>=3000 then
response.write ("<font color='red'>四级会员</font><img src='imges/star_level2.gif'><img src='imges/star_level2.gif'>")
end if%>
</div></td>
</tr>
<tr>
<td height="20">帖子:</td>
<td><div align="left">
<%if user("tz")=0 then response.write("该用户还没发帖")else response.write (""&user("tz")&" 篇")%>
</div></td>
</tr>
<tr>
<td height="20">经验:</td>
<td><div align="left"> <%=user("jy")%></div></td>
</tr>
<tr>
<td height="20">金币:</td>
<td>
<div align="left">
<%
set yin=server.CreateObject ("adodb.recordset")
sql="select * from zf_yinhang where usernemu='"&user("usernemu")&"'"
yin.open sql,conn,1,1
n=yin("zonge")
response.write n
yin.close
set yin=nothing
%>
</div></td>
</tr>
<tr>
<td height="20" colspan="2"><div align="left">注册时间:<%=user("rq")%></div></td>
</tr>
<tr>
<td height="20" colspan="2"><div align="center">加为好友 | 发短信息 </div></td>
</tr>
</table>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)