none
ACCDE corrupt RRS feed

  • Question

  • Hi

    I am using Access 2013.
    When I create a .accde file from DatabaseA.accdb the .accde is corrupt. Some examples:

    Some push buttons doesnt open form but other buttons does.
    Some forms shows the underlying data but other doesnt.

    When I create a .accde file from DatabaseB.accdb the .accde works just fine.

    So it seems to be something wrong with DatanaseA ? But what?

    Only thing wrong with DatabaseA is the Quick Styles please see My Quick Style issues


    Best // Peter Forss Stockholm and Sigtuna GMT +1.00

    Wednesday, August 24, 2016 5:02 AM

Answers

  • There not a surprise that moving to another computer would/could fail.

    However, you’re saying that creating the accDE on the same computer and in the same folder as the accDB that works? – that is most strange.

    I would double check a stray copy of Access is not running (task manager). I would also consider launching access via right click on the short cut to access – use run as administrator – and now create the accDE.

    I seen accDE fail when moving to other computers – but not when the accDB runs perfectly well – and then creating an accDE into the same folder and on the same computer.

    I would delete the accDE file, and then run access as admin – create the accDE into that folder and see if it works. I assumed a debug->compile in the accDB compiles without errors (and if the compile option is grey out, then simply  modify some code module by simply entering a few extra blank lines – then try the compile before creating the accDE).

    Since the  decompile did not work, then perhaps there is still “junk” from a previous edition. So a simple test would be to create a blank new database and then simply import everything into that new blank database. Now try the compile, and if ok, then try creating the accDE from that new database.

    Regards,

    Albert D. Kallal (Access MVP)

    Edmonton, Alberta Canada

    Friday, August 26, 2016 5:25 PM

All replies

  • Did a "repair" of my Office Plus installation.
    But a new try to create a new .accde give the same errors. So maybe its the .accdb thats corrupt although it works fine?
    I'll try to import the accdb to a new accdb.

    Best // Peter Forss Stockholm and Sigtuna GMT +1.00

    Wednesday, August 24, 2016 12:56 PM
  • Hi

    Did an import to a new database. But sorry. No there is no improvments.

    Some push buttons doesnt open form but other buttons does.
    Some forms shows the underlying data but other doesnt.

    And ... colors of push buttons change again. So did the options in Quick Style!


    Best // Peter Forss Stockholm and Sigtuna GMT +1.00

    Wednesday, August 24, 2016 1:38 PM
  • Hi ForssPeterNova,

    I understand that you have an issue with Quick Styles.

    but you had mentioned that when you import the database at that time some button works correctly.

    but some are not working. so did you try to check the code behind of that buttons which are not working?

    try to debug it and check when you click the button it hit the break point or not.

    also check the code that it written correctly or not and does not having any error.

    you can try to make a new button beside that button on the same form and copy the code from the button which is not working and paste in the new button and test it is working or not.

    also If possible try to post the code of buttons which are not working. so that we can also try to test it.

    also you can share the information that can help us to reproduce the issue.

    I agree with you that when we export the form at that time quick styles remove from the controls and also the color of the quick styles get changed.

    but I did not find the behavior that you mentioned above regarding button click is not responding.

    when I test buttons working correctly.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, August 25, 2016 2:57 AM
    Moderator
  • Thanks for helping me Deepak

    It seems like none of the push buttons with a code opening something works.
    I have buttons with macros and they work.

    Examples on code that works in .accdb files but not in the .accde

    Select Case Me.Flik0.Value ‘Flik() is Swedish for Tab()
        Case 1:
            If Me.[Alla tankar underformulär].Form.RecordSource = "" Then
                  DoCmd.Echo False, ""
               Me.[Alla tankar underformulär].Form.RecordSource = QRY1
                   DoCmd.Echo True, ""
            End If
    

    Another Example:

    Private Sub Kommandoknapp85_Click()
        DoCmd.Echo False, ""
    DoCmd.OpenForm "Bryggning", acNormal, """"
        DoCmd.Echo True, ""
    End Sub

    And third example:

    Private Sub Kommandoknapp1_Click()
      If Me.PSWRECEPT.Value = "XXXXX" Then
        DoCmd.Close acForm, "Logga in Recept"
        DoCmd.OpenForm "Recept för Bryggning", acNormal, """"
      Else
        If MsgBox("Invalid password, please try again", vbRetryCancel + vbCritical, "ERROR") = vbCancel Then
          Application.Quit
        Else
          Me.PSWRECEPT.SetFocus
        End If
      End If
    End Sub
    


    Best // Peter Forss Stockholm and Sigtuna GMT +1.00


    Thursday, August 25, 2016 1:44 PM
  • You did create a Trusted Location for the Front-End?

    Daniel Pineault, 2010-2012 Microsoft MVP
    http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Thursday, August 25, 2016 2:06 PM
  • Hi Daniel

    I run all on my laptop. Both FE and BE.

    Older versions of the FE works fine with the BE.


    Best // Peter Forss Stockholm and Sigtuna GMT +1.00

    Thursday, August 25, 2016 2:23 PM
  • So what has changed? Have you edited code? Moved the FE? Changed its name?

    I would still urge you to validate that you have a Trusted Location for the FE.  Just double check spelling, path, ... to be 100% sure.


    Daniel Pineault, 2010-2012 Microsoft MVP
    http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Thursday, August 25, 2016 3:22 PM
  • Hi Daniel

    I have added a Trusted Location for the FE and the BE.
    After that I saved a new .accde

    Still the push button dont open the Forms.

    I have edited the code:

    Select Case Me.Flik0.Value ‘Flik() is Swedish for Tab()
        Case 1:
            If Me.[Alla tankar underformulär].Form.RecordSource = "" Then
                  DoCmd.Echo False, "" 'THIS LINE IS NEW
               Me.[Alla tankar underformulär].Form.RecordSource = QRY1
                   DoCmd.Echo True, "" 'THIS LINE IS NEW
            End If

    I removed the two lines DoCmd.Echo False....

    Still the push button dont open the Forms.


    Best // Peter Forss Stockholm and Sigtuna GMT +1.00

    Thursday, August 25, 2016 8:10 PM
  • Next I would decompile the accdb:

    <path to>msaccess.exe <path_to>your.accdb /decompile

    Then compact and create new accde.


    -Tom. Microsoft Access MVP

    Thursday, August 25, 2016 8:37 PM
  • I could be way off, but when I create Case statement I've never included a colon

    I'd normally be doing

    Case 1

    Instead of

    Case 1:


    Daniel Pineault, 2010-2015 Microsoft MVP<br/> <a href="http://www.cardaconsultants.com">http://www.cardaconsultants.com</a><br/> MS Access Tips and Code Samples: <a href="http://www.devhut.net">http://www.devhut.net</a>

    Friday, August 26, 2016 1:01 AM
  • Indeed way off. Either way is OK.

    x=1 : y=2 : z=3

    Also:

    Case 1:::::::::::::::


    -Tom. Microsoft Access MVP

    Friday, August 26, 2016 1:48 AM
  • Yes, VBA still has some “very” old syntax and carry over from the original QuickBasic and that has carry over’s from GWBASIC.

    In those “old” basic systems, the “:” was a line separator or better called a statement continuing character.

    IF true then statement 1: statement 2: statement 3

    In above syntax, no if/then/else was used (or existed), but statements 1-3 would be execute if true.

    And even this is still legal

    statement 1: statement 2: statement 3

    And, when tight for space, or you want to save code space you can change thus place multiple lines on one line.

    In fact, this code snip is from vb.net, and again it supports this 30 year old archeological syntax.

    Eg:

    Public Function UpLoadPreviewt(strF As String) As String

            ' if extension is zip, then show preview icon

            Select Case Path.GetExtension(strF)

                Case ".pdf" : Return Path.ChangeExtension(strF, ".pgn")

                Case ".zip" : Return "~/Content/zip-icon.png"

                Case Else : Return ""

            End Select

        End Function

    You could write the above as this:

        Public Function UpLoadPreview(strF As String) As String

            ' if extension is zip, then show preview icon

            Select Case Path.GetExtension(strF)

     

                Case ".pdf"

                    ' a preview of SAME file but with .png

                               ' should exist, return that

                    Return Path.ChangeExtension(strF, ".pgn")

     

                Case ".zip"

                    Return "~/Content/zip-icon.png"

     

                Case Else

                    Return ""

      

           End Select

        End Function

    One of the reasons I choose vb.net over c# is my rather old habits carry over!

    Regards,

    Albert D. Kallal (Access MVP)

    Edmonton, Alberta Canada



    Friday, August 26, 2016 2:54 AM
  • Hi ForssPeterNova,

    Did you try to Debug?

    what happens if we put break point on click event of button and click the button?

    did the event get executed?

    if you didn't check it before. I suggest you to check it.

    so that we can know that event is working or not.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, August 26, 2016 3:10 AM
    Moderator
  • Will do

    Best // Peter Forss Stockholm and Sigtuna GMT &#43;1.00

    Friday, August 26, 2016 5:12 AM
  • will do

    Best // Peter Forss Stockholm and Sigtuna GMT &#43;1.00

    Friday, August 26, 2016 5:13 AM
  • Hi

    How can I see if a Decompile is successfull?


    Best // Peter Forss Stockholm and Sigtuna GMT &#43;1.00

    Cause i did one, but my troubles with pushbuttons not working is still there in the new .accde file I create after decompile.

    I created a new pushbutton vid a simple line of code.

    Private Sub Kommandoknapp7_Click()
    MsgBox "Break 1", vbOKOnly, ""
    End Sub

    In the ACCBD it results in a MsgBox

    In the ACCDE - nothing happens :-(


    Friday, August 26, 2016 10:08 AM
  • I found and used this code in a second atempt:

    Option Explicit
    Dim MSAccPath
    Dim RegKey
    Dim WSHShell
    Dim currentDirectory

    ' Get MSACCESS.exe directory
    RegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\" _
        & "CurrentVersion\App Paths\MSACCESS.EXE\Path"
    Set WSHShell = WScript.CreateObject("WScript.Shell")

    ' Get parent directory
    MSAccPath = WSHShell.RegRead(RegKey)
    currentDirectory = WSHShell.CurrentDirectory

    ' Decompile
    WSHShell.Run Chr(34) & MSAccPath & "MSACCESS.EXE" & Chr(34) & " " & Chr(34) & currentDirectory & "\..\testdb.accdb" & Chr(34) & " /decompile"

    ' Clear shell var
    Set WSHShell = Nothing

    Found it here - Click

    But still the not working event procedure driven pushbutton is the same.


    Best // Peter Forss Stockholm and Sigtuna GMT &#43;1.00


    Friday, August 26, 2016 10:43 AM
  • Typo in ".pgn"

    -Tom. Microsoft Access MVP

    Friday, August 26, 2016 3:18 PM
  • As a follow up. Are you saying the application does not work on your dev computer when you create the ACCDE and run it from the same folder in which the ACCDB runs?

    Or are these problems occurring when you move or try the accDE on different computers?

    Regards,

    Albert D. Kallal (Access MVP)

    Edmonton, Alberta Canada

    Friday, August 26, 2016 4:24 PM
  • Hi Albert

    These problem with the .ACCDE is everywhere.

    On my dev computer running it in the same folder as the .ACCDB too.

    Old buttons with old vba code.
    New Buttons with new VBA code.


    Best // Peter Forss Stockholm and Sigtuna GMT &#43;1.00

    Friday, August 26, 2016 5:02 PM
  • There not a surprise that moving to another computer would/could fail.

    However, you’re saying that creating the accDE on the same computer and in the same folder as the accDB that works? – that is most strange.

    I would double check a stray copy of Access is not running (task manager). I would also consider launching access via right click on the short cut to access – use run as administrator – and now create the accDE.

    I seen accDE fail when moving to other computers – but not when the accDB runs perfectly well – and then creating an accDE into the same folder and on the same computer.

    I would delete the accDE file, and then run access as admin – create the accDE into that folder and see if it works. I assumed a debug->compile in the accDB compiles without errors (and if the compile option is grey out, then simply  modify some code module by simply entering a few extra blank lines – then try the compile before creating the accDE).

    Since the  decompile did not work, then perhaps there is still “junk” from a previous edition. So a simple test would be to create a blank new database and then simply import everything into that new blank database. Now try the compile, and if ok, then try creating the accDE from that new database.

    Regards,

    Albert D. Kallal (Access MVP)

    Edmonton, Alberta Canada

    Friday, August 26, 2016 5:25 PM
  • Albert!

    Thank you very very much. Now I have a working accDE again.

    1. Started Access ad Admin

    2. Imported the "old" accDB to a new accDB

    3. Still running as Admin I saved the new accDB to a accDE


    Best // Peter Forss Stockholm and Sigtuna GMT &#43;1.00

    Sunday, August 28, 2016 6:17 AM
  • OK :-(

    Now I'm not able to create a working accDE again.

    I did as above.

    Did like this too.

    Decompile the accDB
    As Admin I imported it to a new accDB
    As Admin I created a accDE

    Compiling after decompile gives no errors

    But code will not run. Makros only.

    To see if its my msaccess.exe 2013 causing the troubles or not, I moved the file to our server running Access 2016. But nope the accDE will not run the code.


    Best // Peter Forss Stockholm and Sigtuna GMT &#43;1.00


    Wednesday, September 7, 2016 12:04 PM