Re: Searching for duplicates in disconnected recordset

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Veign (NOSPAMinveign_at_veign.com)
Date: 10/15/04

  • Next message: Melvin.Ding: "Re: Adobc & DataGrid Binding"
    Date: Thu, 14 Oct 2004 22:57:48 -0400
    
    

    This is the SQL code to do through ADO.

    "SELECT fToCheck, Count(*) AS RowCount " & _
    "FROM tblMyTable " & _
    "GROUP BY fToCheck HAVING Count(*) > 1"

    Where:
    fToCheck is the name of the field to check for duplicates
    tblMyTable is the name of your table

    -- 
    Chris Hanscom - Microsoft MVP (VB)
    http://www.veign.com
    --
    "John Wright" <rileyx_wright@hotmail.com> wrote in message
    news:u6sA9DksEHA.3972@TK2MSFTNGP15.phx.gbl...
    > I have a disconnected recordset and I need to check if there are
    dupliacated
    > values in one field.  Does anyone have a way to do this quickly.  I have a
    > routine that will work, but it takes a long time.  I was trying to do a
    > group by query on the recordset with a count field and check the values of
    > the count to see if they are greater than one, but I don't know how to do
    > this on an ADO recordset.  I can do it in a ADO.NET dataset with no
    > problems.  I was thinking of dumping the column into an array and trying
    to
    > find a duplicate in the array.  Any code would be appreciated.
    >
    > John
    >
    >
    

  • Next message: Melvin.Ding: "Re: Adobc & DataGrid Binding"