Hi there,
It depends a little on why you have the duplicates, and where you want to hide / filter them.
For example, you can use the keyword DISTINCT in an SQL query so it just returns unique records. This is a clean and quick way as it will just return the relevant records from the database, instead of passing them all.
Alternatively, you can use some loop code in ASP to accomplish this. To make this work, you duplicate records should come after each other in the recordset, so make sure you use a good ORDER BY clause to sort them correctly.
Code:
<%
Dim OldValue
Do While Not myRS.EOF
If myRS("Column1") = OldValue Then
' Product has already been sent to the browser, so do nothing
Else
Response.Write(myRS("Column1"))
myRS("Column1") = OldValue
End If
myRS.MoveNext()
Loop
%>
This code prints out the value for Column1. Before it does that, it checks whether it has already been written. If not, it's value is added to the page Response, and the variable OldValue is filled with the current value from the Recordset.
You should consider the cause of the problem as well/ Should you duplicate records have been in the database in the first place?
Does this help?
Regards,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.