Results 1 to 5 of 5

Thread: Im stumped.

  1. #1
    Join Date
    Nov 2002
    Location
    Melbourne
    Posts
    92

    Unanswered: Im stumped.

    Ive tried everything I can think of to solve my problem and using help from another has solved my problem. They have been very help but nothing has help.

    Im hoping that some here might have to solution.

    Im trying to compact my DB but Im getting a corrupt record somewhere, at least I think its a record. After attempting to compact a copy of DB is place in the same folder and the error code is 1611.

    I made a copy of the DB and try to delete the tables one by one then tried to compact after each table was deleted. Still I couldnt compact. Hmmm

    Im using A97 and get desperate for a solution because my DB is bloating a rediculeous size.

    I tried using the following code supplied by R Hicks but It didnt help me. Im sure the code is fine but it just didnt me in this case. Im adding the code in case anyone might like to use it to find corrupt records.

    Private Sub Command0_Click()
    Dim MyDB As DAO.Database
    Dim myset As DAO.Recordset
    Dim myPrimaryKeyID As String
    Dim myCurrentField As Variant
    Dim myFieldCount As Long
    Dim i As Long

    Set MyDB = CurrentDb
    Set myset = MyDB.OpenRecordset("tblreferrals")

    With myset
    myFieldCount = .Fields.Count - 1
    .MoveFirst
    Do Until .EOF
    i = 0
    myPrimaryKeyID = .Fields(0)
    For i = 0 To myFieldCount Step 1
    myCurrentField = myset.Fields(i)
    Next i
    .MoveNext
    Loop
    End With

    myset.Close
    Set myset = Nothing
    Set MyDB = Nothing

    End Sub

  2. #2
    Join Date
    Jan 2003
    Location
    Rockville, MD
    Posts
    179
    Have you tried creating a new mdb, then importing the objects from your corrupt mdb?

    Sometimes that will identify which object is corrupt.

  3. #3
    Join Date
    Nov 2002
    Location
    Melbourne
    Posts
    92
    No! actually I havent tried that..worth a try though. I'll try and see what happens.

    Thanks for the tip.
    Last edited by billjov; 09-11-03 at 00:06.

  4. #4
    Join Date
    Nov 2002
    Location
    Melbourne
    Posts
    92
    That worked!! I imported all the tables etc and then did a compact. It compacted without a problem.

    Thanks.
    Last edited by billjov; 09-11-03 at 00:55.

  5. #5
    Join Date
    Jan 2003
    Location
    Rockville, MD
    Posts
    179

    Thumbs up

    Glad it worked for you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •