Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70

    Lightbulb Unanswered: How to REPAIR/Decompile a database...

    1.Backup your DB
    2.Set Compile on Demand to OFF.
    3.Desable any startup code (StartupForm,..)
    3.1 Optional:
    - Compact and Repair Database at least One-times
    - But it is usefull try it more times...
    4.Close all access instances (see: Task manager)
    5.create shortcut and start it
    Acces_path\myDb1.mdb /DECOMPILE
    Acces_path\myDb1.mdb /DECOMPILE /NOSTARTUP (?)
    6.Save your DB and quit access
    7.Start access again, load your DB normally, and immediately compile your project
    8.Quit and restart access
    -----------------------------
    9. Any other Ideas or expieriences....(?)
    -----------------------------
    But may be the DB is allways wrong,...
    Last edited by pacala_ba; 03-08-09 at 06:50.
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Sorry fella - I've not followed all your threads (i'll nose now), but have you tried the old trick of creating a new, blank database and importing all objects from the corrupt one?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    Yes i do it about 3 (three) times every Day
    But sometimes the new one immediatly crashes, than
    Reporting Error to Microsoft and Repair
    only one-times sometimes O.K.
    TWO-, THREE-times and than new ONE is O.K.
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    what is the problem you are trying to fix?

    i keep my code and my data in different files.

    my problem is that the code "db" sometimes gets confused after lots of editing. in the past i used /decompile, but i got fed up with the strict and ugly process so i made a small (Access) application to do the .MDB --> .TXT --> .MDB stuff. to the naked eye it does the same job as /decompile (resulting files are identical in size), and adds a couple of bonus items:
    - a small uniquely named backup directory containing all my non-data as .TXT
    - browsing the .TXT is a great educator in form design

    i didn't have a problem with data so far (and most of my apps autobackup anyway so i'm not that scared). i set all my JET data db to compact on close, but being a separate data db it is never "opened" and therefore never "closed" in normal life.
    my app exit routines calculate expected filesize vs record count and divert exit to a "compacter" .MDE when bloat exceeds reasonable bounds.

    if i did have data problems, i think i would also try a .TXT (.CSV) approach. at first sight the issue with automating this is determining the import sequence so that FK have a PK to look at by the time they are imported ...shouldn't be impossible to work it out, but i didn't try yet.

    izy
    currently using SS 2008R2

  5. #5
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    My problem is , that i have an large non-tables database.
    Before cca. 1 year i have NONE problems.
    Now i have allways problem, when i make new Version/Build of MDE,
    (Only small little changes, but every 1-10 days ) it is difficult to create 'GOOD' new one MDE, that not crashes and is Compiler-Error free...
    The Suucces rate is ONLY 5-20%...!!!!
    Sometimes works better One-Direct-MDE, sometimes Four-References-MDE,
    sometimes Four-References-MDB, Sometimes ExportAsText/LoadAsText,...
    i keep my code and my data(=Tables) in different files...the same by me
    Last edited by pacala_ba; 03-09-09 at 12:04.
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    When I have corruption issues like , I usually go back to the last known stable version and work forward from there.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  7. #7
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    i have one-only-for-edit MDB, and than
    i allways create the For-use-MDB-MDE (Single or Four/references)

    This works with success rate ~ 5-20 %
    but without CompactRepair is success rate ~ 0-1 %
    MDB-TXT-MDB
    Code:
    Dim m_path$, m_DateTimeString$, m_app As Access.Application
    ....
    Public Sub SaveMDBObjectsAsText()
        Dim R As Reference, path_txt$, cDDF_MDE$, ln_KUK As VbMsgBoxResult
        Dim ln_Answer As VbMsgBoxResult, ll_PRINT As Boolean, ll_REPAIR As Boolean
        Dim FileName1$, FileName2$, i_r&, i_r_max&, lc__proc_meno$
        lc__proc_meno = "SaveMDBObjectsAsText"
        m_DateTimeString = Format(Now(), "yyyymmddhhnn")
        m_path = CurrentProject.path & "\AS_TEXT_" & m_DateTimeString & "\"
        path_txt = m_path
    Debug.Print "Start app..."
    ln_Answer = vbNo
    ll_REPAIR = True
    i_r_max = InputBox("Repair_count0 ?", lc__proc_meno, 3)
    If ln_Answer = vbCancel Then
        Exit Sub
    End If
    If ln_KUK = vbCancel Then
        Exit Sub
    End If
    ll_PRINT = (ln_Answer = vbYes)
    If ll_PRINT Then Debug.Print "Mjk Path..."
        MkDir m_path
        Set m_app = New Access.Application
    If ll_PRINT Then Debug.Print "SaveMDBBase"
        SaveMDBBase ' ?????
    '----------------------------------------
    If ll_PRINT Then Debug.Print "SaveDataAccessPagesAsText"
        SaveDataAccessPagesAsText ll_PRINT
    If ll_PRINT Then Debug.Print "SaveFormsAsText"
        SaveFormsAsText ll_PRINT
    If ll_PRINT Then Debug.Print "SaveReportsAsText"
        SaveReportsAsText ll_PRINT
    If ll_PRINT Then Debug.Print "SaveModulesAsText"
        SaveModulesAsText ll_PRINT
    If ll_PRINT Then Debug.Print "SaveQueriesAsText"
        SaveQueriesAsText ll_PRINT
    If ll_PRINT Then Debug.Print "SaveMacrosAsText"
        SaveMacrosAsText ll_PRINT ' chybalo !!
    '----------------------------------------
    If ll_PRINT Then Debug.Print "LoadDataAccessPagesFromText"
        LoadDataAccessPagesFromText ll_PRINT
    If ll_PRINT Then Debug.Print "LoadFormsFromText"
        LoadFormsFromText ll_PRINT
    If ll_PRINT Then Debug.Print "LoadReportsFromText"
        LoadReportsFromText ll_PRINT
    If ll_PRINT Then Debug.Print "LoadModulesFromText"
        LoadModulesFromText ll_PRINT
    If ll_PRINT Then Debug.Print "LoadQueriesFromText"
        LoadQueriesFromText ll_PRINT
    If ll_PRINT Then Debug.Print "LoadMacrosFromText"
        LoadMacrosFromText ll_PRINT
    '----------------------------------------
        On Error Resume Next
        With m_app
            With .CurrentProject
                m_path = .FullName
            End With
            If ll_PRINT Then Debug.Print "References Remove"
            For Each R In .References
                With R
                    If Not .BuiltIn Then
                        If ll_PRINT Then Debug.Print "ref-remove: " & R.Name
                        m_app.References.Remove R
                    End If
                End With
            Next R
            For Each R In References
                With R
                    If Not .BuiltIn Then
                        If ll_PRINT Then Debug.Print "ref-AddFromGuid: " & R.Name
                        m_app.References.AddFromGuid R.Guid, R.Major, R.Minor
                    End If
                End With
            Next R
    '------------------------
    FileName1 = m_app.CurrentProject.FullName
    FileName2 = Replace(FileName1, ".MDB", "_TMP.MDB")
    If ll_REPAIR Then
    If True Then Debug.Print FileName1
    If True Then Debug.Print FileName2
         .CloseCurrentDatabase
         GoSub F_DDF_REP
        .OpenCurrentDatabase FileName1
    End If
    '--------- ' AUTOEXEC = OFF..??
            Debug.Print "DoCmd.RunCommand acCmdCompileAndSaveAllModules"
            .RunCommand acCmdCompileAndSaveAllModules
            Debug.Print "CloseCurrentDatabase"
            .CloseCurrentDatabase
    ' make MDE
    ' off.............GoSub F_DDF_REP
    If ll_PRINT Then Debug.Print ".SysCmd 603, path=" & m_path
    cDDF_MDE = Replace(UCase$(m_path), "_TEXT.MDB", ".MDE")
    .SysCmd 603, m_path, cDDF_MDE
    Debug.Print "MDE= " & (Len(Dir$(cDDF_MDE)) > 0) & ", " & cDDF_MDE
            .Quit
        End With
    If ll_PRINT Then Debug.Print "Set app = Nothing"
        Set m_app = Nothing
    Debug.Print "OK..."
        If MsgBox("OK, Delete Text Backup" & vbCrLf & path_txt, vbYesNo + _
            vbDefaultButton1, "ACC-TXT-BACKER") = vbYes Then
            Kill path_txt & "*.TXT"
            RmDir path_txt
        End If
    Exit Sub
    F_DDF_REP:
    For i_r = 0 To i_r_max
        m_app.CompactRepair FileName1, FileName2
        Kill FileName1
        Name FileName2 As FileName1
    Next i_r
    Return
    End Sub
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  8. #8
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    Hi
    test-example (V5005, ~95% of original) , Free Admin-access
    of CRASHING very-large-non-tables-database and
    Wrong Compiler (String cutter, see other thread)...
    Try to use it, Compile,edit, make MDE,add your own code...and you will see
    V5002,3,4,5-New Error handler.
    http://www.dbforums.com/microsoft-ac...ler-wrong.html
    Attached Files Attached Files
    Last edited by pacala_ba; 03-18-09 at 13:39.
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  9. #9
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    An typical Compiler error example:
    Code:
    ERR-TEXT_: 	'' is an invalid name.                                                         
    ERR-NUMBR: 	2091
    ******************************************
    PROCEDURE: 	INI_AC_OPTIONS_DFT
    MODUL____: 	MOD_ZZ5_000 6.487, <xPAC> ESO V6.2.5001
    SOURCE___: 	xPAC_DFT
    ERR-TOTAL: 	1
    STOP-RETRY
    The Error line
    Code:
    Application.SetOption "Default Find/Replace Behavior", 0
    The same in immediate OK !!!!!!!!!!
    What is WRONG there ..?
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

  10. #10
    Join Date
    Mar 2009
    Location
    SLOVAKIA,Bratislava
    Posts
    70
    Hi, Sinndho, Thanks for new Ideas !!!
    -------------------------------------
    New error handler in attachment for nested errors (V5002)
    But i am Stepping code line-by-line on this error
    ERR-TEXT_: '' is an invalid name.
    than in my case is there other problem....
    15 years db-programmer(dBase,FoxPro,MS Access 2002/2003),Symbian C++

Posting Permissions

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