Hello experts,

I'm currently doing a C# project which involves removing duplicate
time entries in Access.
I was able to store the unique records safely to a collection using a
Dictionary. Now I need
to remove/purge the database of all the duplicates involved. One way
to retrieve all duplicate
records is to run this query which I got from the Access Wizard:

SELECT CHECKINOUT.CHECKTIME, CHECKINOUT.USERID
FROM CHECKINOUT
WHERE (((CHECKINOUT.CHECKTIME) IN (SELECT [CHECKTIME] FROM
[CHECKINOUT] AS TMP )))
ORDER BY CHECKINOUT.CHECKTIME;

Now, I want to delete the records out of it by using sql delete like
this:

Delete from CheckInOut where exists(
SELECT CHECKINOUT.CHECKTIME, CHECKINOUT.USERID
FROM CHECKINOUT
WHERE (((CHECKINOUT.CHECKTIME) IN (SELECT [CHECKTIME] FROM
[CHECKINOUT] AS TMP )))
ORDER BY CHECKINOUT.CHECKTIME)

When run through C# code (using OleDbCommand), I get an exception
like: "Attempted to read or write protected memory. This is often an
indication that other memory is corrupt".

When run through MS Access, I get a crash report which states:
"Microsoft Office Access has
encountered a problem and needs to close...."

Is there another way for me to remove the duplicates using an
alternative sql command?




Benj




Reply via email to