读书人

急该怎么处理

发布时间: 2012-03-07 09:13:51 作者: rapoo

急急急
在区域(qy)那显示图片显示不出来为什么呀?谢谢?
<%

dim rssql2,PageSize,RowCount,TotalPages,PageNo,Position,PageBegin,PageEnd


set conn = server.CreateObject( "ADODB.connection ")
set rs= server.CreateObject( "ADODB.RecordSet ")
conn.open( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= "&server.MapPath( "zhongzhong.asp "))
rssql2 = "select * from house where fwlb= '求购 ' order by sj desc "
rs.open rssql2,conn,3,3

PageSize=20


PageSize=20

If rs.RecordCount=0 then

%>





<%

else

rs.PageSize = Cint(PageSize)

TotalPages=rs.PageCount

PageNo=Request.QueryString( "PageNo ")

if PageNo= " " or PageNo <1 Then

PageNo = 1

end if

rs.AbsolutePage = PageNo

Position=rs.PageSize*PageNo

PageBegin=Position-rs.PageSize+1

if Position <rs.RecordCount then

PageEnd=Position



else

PageEnd= rs.RecordCount

end if

%>

<TABLE WIDTH=529 BORDER=0 CELLPADDING=1 CELLSPACING=1 style= 'font-size:9pt '>

<TR >

<TD colspan= "2 ">

<%

Response.Write "页 "& PageNo & " / "& TotalPages & " |记录 "& PageBegin & " - " & PageEnd & " / " &rs.RecordCount

%>

</TD>

</TR>
<TR bgcolor=#003366 height=20px>

<td width= "20% "> <div align= "center "> 区域 </div> </td>
<td width= "140 "> <div align= "center "> 路段 </div> </td>
<td width= "92 "> <div align= "center "> 户型 </div> </td>
<td width= "100 "> <div align= "center "> 价位 </div> </td>
<td width= "90 "> <div align= "center "> 查看详情 </div> </td>

</TR>




<%

RowCount = rs.PageSize

dim color1,color2

color1= "#dddddd "

color2= "#eeeeee "


Do While Not rs.EOF and RowCount > 0

Response.Write " <TR height=20px bgcolor= "

%>

<%

if RowCount mod 2=0 then:response.write color1 else:response.write color2

%>

<%

Response.Write "> "

%>


<%
dim daydiff
daydiff=DateDiff( "d ",rs( "sj "),now())
if daydiff <2 and daydiff> 0 then
%>
<td> <div align= "center "> <img src= "images/new-022.gif " > <%=rs( "qy ")%> </div> </td>
<%else%>
<td> <div align= "center "> <%=rs( "qy ")%> </div> </td>
<%end if%>


<td> <div align= "center "> <%=rs( "ld ")%> </div> </td>


<td> <div align= "center "> <%=rs( "hx ")%> </div> </td>
<td> <div align= "center "> <%=rs( "fj ")%> </div> </td>
<td> <div align= "center "> <a href=fwxx.asp?id= <%=trim(rs( "id "))%> class= "linkone "> 查看详情 </a> </div> </td>
</tr>


</TR>

<%

RowCount = RowCount - 1

rs.MoveNext

Loop

conn.Close

set rs = nothing

set conn = nothing

%>


<TR>

<TD>

<%

For i=1 to TotalPages

if CInt(PageNo) = CInt(i) then

response.write "[ "&i& "] "



else

response.write "&nbsp <a href=qiugouxx.asp?PageNo= "&i& "> "&i& " </a> &nbsp "

end if

Next

%>
</TD>

</TR>

</TABLE>

<%

End if

%>

</table>

[解决办法]
'-----------------------------引用----------------------------------------
<%
dim daydiff
daydiff=DateDiff( "d ",rs( "sj "),now())
if daydiff <2 and daydiff> 0 then
%>
<td> <div align= "center "> <img src= "images/new-022.gif " > <%=rs( "qy ")%> </div> </td>
<%else%>
<td> <div align= "center "> <%=rs( "qy ")%> </div> </td>
<%end if%>
'-----------------------------引用----------------------------------------

daydiff=DateDiff( "d ",rs( "sj "),now()) 里面的 "d "代表天数 sj字段的日期是否和当前时间now相差了两天以上,所以不显示
now()是操作系统的时间,估计你的操作系统时间有问题,拿系统时间跟sj字段对比一下便知!


[解决办法]
up

读书人网 >ASP

热点推荐