Question : Locate Corrupt Record In An Access Table

I have an access 2003 table that contains over 18,000 records. Is there any way to locate corrupt records without scrolling through each record?

Answer : Locate Corrupt Record In An Access Table

place this codes in a module , change name of table

that will read all the records and output to a text file. if a record is non readable the code will stop.

open the text file and see the last line recorded, the next record for that will be the corrupted one.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Sub chkCorruptRec()
Dim rs As DAO.Recordset, j As Integer, strData As String
Open "C:\myText.txt" For Output As #1
Set rs = CurrentDb.OpenRecordset("Customers")
rs.MoveFirst
Do Until rs.EOF
    For j = 0 To rs.Fields.Count - 1
        strData = strData & ", " & rs(j)
    Next
    strData = Mid(strData, 3)
    Print #1, strData
    strData = ""
    rs.MoveNext
Loop
rs.Close
Close #1
End Sub
Random Solutions  
 
programming4us programming4us