
August 16th, 2012, 03:26 PM
|
|
Registered User
|
|
Join Date: Sep 2011
Posts: 5
Time spent in forums: 3 h 6 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by Doug G Oh, I didn't realize you just wanted copy & paste code without understanding. Sorry. |
From your grumpy comment I realized I must have done something unnecessary in the code. So I looked through it and figured the for loop was stupid of me to add.
Now my code is:
Code:
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "DSN=forsale"
conn.Open
sql = "SELECT Subject, DatePosted FROM ForSale WHERE ((([DatePosted])<Now()) And (([DateRemove])>Now() Or ([DateRemove]) Is Null)) And ((([Display])=True)) ORDER BY DatePosted DESC"
set rs = conn.execute(sql)
do until rs.EOF
If rs("DatePosted")> DateAdd("D", -14 , Now) Then 'no posts over 14 days old
Response.Write("<li><a href=/ForSale/forsale.asp#" & Replace(rs("Subject"), " ", "") & "'>" & rs("Subject") & "</a></li>")
end if
rs.MoveNext 'next row
loop
rs.close
conn.close
%>
Everything in the code (except the do until rs.EOF and the variable names) are mine. I also understand everything in the code. Still grumpy?
|