locked
Ms Access 2019 I could not create an accde file RRS feed

  • Question

  • I am using ms access 2019 on a 2016 server and i am unable to create an accde or accdc file.
    I state that I can convert the same file to accde using vba, so it's not a database problem but it's an MS Access problem.
    I tried reinstalling MS Access but the problem persists.
    Can anyone help me?

    Marco Dell'Oca

    Wednesday, February 5, 2020 5:32 PM

Answers

  • When you select the File tab, do you see the File Save As option for a .accde?
    • Marked as answer by Marco Dell'Oca Saturday, February 8, 2020 11:14 AM
    Wednesday, February 5, 2020 7:28 PM
  • Do you have any blank procedures within your database, subs/functions/... with nothing inside them, if so, delete and try again.

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

    • Marked as answer by Marco Dell'Oca Saturday, February 8, 2020 11:14 AM
    Wednesday, February 5, 2020 8:13 PM
  • What File Save AS options do you have? One of them should be File Save As an .accde file.
    • Marked as answer by Marco Dell'Oca Saturday, February 8, 2020 11:16 AM
    Wednesday, February 5, 2020 8:39 PM
  • Hi Lawrence

    Hi Daniel

    I found the problem.
    In my database, if I remove the name of the form to be displayed from the optionals menu, everything works perfectly.
    If, on the other hand, I enter the name of a form to be displayed when the database is opened, it no longer allows me to create an .accde file.
    It seems strange.
    What do you think?

    Marco Dell'Oca

    Hi Marco,

    It could mean that you start-up form is having a problem.

    Do you in your VBA code include "Option Explicit"?

    Do you compile the code in your VBA editor?

    Naming Conventions - like a control/textbox/combobox...etc sharing with reserved names? Like "Name" is a reserved word in Access...etc.

    Any Macros being use with problem/s?

    • Marked as answer by Marco Dell'Oca Saturday, February 8, 2020 11:15 AM
    Thursday, February 6, 2020 8:33 AM
  • That is very weird.

    Have you tried decompiling, compact and repair, compile, compact and repair?

    Have you tried creating a new blank database and importing everything there

    Does your code compile without errors?  You are using Option Explicit in all your modules?


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

    • Marked as answer by Marco Dell'Oca Saturday, February 8, 2020 11:14 AM
    Thursday, February 6, 2020 12:31 PM
  • Also if I remove this step of the program, I have to find another way to prevent closing the main form if not using the appropriate closing button of the application.

    Hi Marco,

    You could disable the CloseButton of the application.

    Google "AccessCloseButtonDisabled" for more information.

    Imb.

    • Marked as answer by Marco Dell'Oca Saturday, February 8, 2020 11:15 AM
    Friday, February 7, 2020 8:25 PM
  • I would suggest that you hold down the shift key during startup.

    You don't really want any code running when you attempt to create a accDE.

    In other words? Well, if you have a airplane flying full of people? Well, the mechanics now can't walk out on the wings and start working on the engines etc. WHILE they are running.

    So, if timer code is running, or even some some general form is loaded and running?

    Well you can't really develop,, or do much in the way of "developer" things, and that includes compiling the application.

    Your startup code might disable certain keys, hide the ribbon - 100's and 100's of settings we often have in a typical access application.

    So, to test + run your application in "user" mode, then you just launch it, and test it out. However, when you have to change things (put your developer hat on), then you exit the application and then re-launch the application while holding down the shift key. 

    So, now the ribbon etc. and things like "special access keys", and a HUGE number of settings you have set in the startup code, and the application settings are IGNORED. You can now freely develop your application, change code, and "maybe" test some forms. But once again, to REALLY test in "user" mode, you will exit, and then re-launch the application (again without shift key) and try your  application in "user" mode.

    This shift key dance, and running your application as "user mode" - letting your startup code run etc., and then exiting and holding down the shift key to go back into developer mode will occur 100's of times in a day, and is the same basic concept as attempting to change or work on a water pump for a car, but do so WHILE it is running.

    So, for any basic requirements of developing software with Access, you CAN NOT allow your startup forms and code to run. And the same goes for attempting to create a accDE. You can ONLY achieve some progress as a developer by launching your application with the shift by-pass key, and NOT allow any code to run.

    So it not only attempting to create a accDE file can be effected by running code, but quite much near any of the development process of changing things and writing code can't occur if you allow the "many" startup settings we have in a application , and startup code to run. Just the  basic settings like "user special access keys" and stuff is 100% ignored if you launch the application with a shift key by-pass (launch holding down the shift key during startup).

    So, if you every say worked on a toaster, or a car or a electrical socket? Well, you have to turn the power off, and or turn the device off in most cases to do any work on that "thing". So, engines, appliances, power tools, and even software are all much the same - you don't want it running when you working on it.

    Try this without ANY startup code or forms or anything being allowed to run or occur when you open the application (do the sift key by-pass).

    At this point, then without access "running" and doing things, then it should allow you to create the accDE file.

    Regards,

    Albert D. Kallal (Access MVP 2003-2017)
    Edmonton, Alberta Canada


    Saturday, February 8, 2020 12:57 AM

All replies

  • When you select the File tab, do you see the File Save As option for a .accde?
    • Marked as answer by Marco Dell'Oca Saturday, February 8, 2020 11:14 AM
    Wednesday, February 5, 2020 7:28 PM
  • Hi Lawrence

    absolutely no. Nothing happen.

    Marco Dell'Oca

    Wednesday, February 5, 2020 7:37 PM
  • Do you have any blank procedures within your database, subs/functions/... with nothing inside them, if so, delete and try again.

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

    • Marked as answer by Marco Dell'Oca Saturday, February 8, 2020 11:14 AM
    Wednesday, February 5, 2020 8:13 PM
  • What File Save AS options do you have? One of them should be File Save As an .accde file.
    • Marked as answer by Marco Dell'Oca Saturday, February 8, 2020 11:16 AM
    Wednesday, February 5, 2020 8:39 PM
  • Hi Lawrence

    Maybe I didn't understand the question well.
    When I open the save as window I find the File Save As an .accde file selection but when I click on it nothing happens.

    Marco Dell'Oca

    Wednesday, February 5, 2020 10:03 PM
  • Hi Daniel
    I have many procedures, subtitles, functions, it could be hundreds,
    Maybe some are empty, but then why can I create the .accde file with the VBA code?
    How can I find the empty one?
    Thank you

    Marco Dell'Oca

    Wednesday, February 5, 2020 11:14 PM
  • Hi Lawrence

    Hi Daniel

    I found the problem.
    In my database, if I remove the name of the form to be displayed from the optionals menu, everything works perfectly.
    If, on the other hand, I enter the name of a form to be displayed when the database is opened, it no longer allows me to create an .accde file.
    It seems strange.
    What do you think?

    Marco Dell'Oca
    Thursday, February 6, 2020 12:57 AM
  • Hi Lawrence

    Hi Daniel

    I found the problem.
    In my database, if I remove the name of the form to be displayed from the optionals menu, everything works perfectly.
    If, on the other hand, I enter the name of a form to be displayed when the database is opened, it no longer allows me to create an .accde file.
    It seems strange.
    What do you think?

    Marco Dell'Oca

    Hi Marco,

    It could mean that you start-up form is having a problem.

    Do you in your VBA code include "Option Explicit"?

    Do you compile the code in your VBA editor?

    Naming Conventions - like a control/textbox/combobox...etc sharing with reserved names? Like "Name" is a reserved word in Access...etc.

    Any Macros being use with problem/s?

    • Marked as answer by Marco Dell'Oca Saturday, February 8, 2020 11:15 AM
    Thursday, February 6, 2020 8:33 AM
  • That is very weird.

    Have you tried decompiling, compact and repair, compile, compact and repair?

    Have you tried creating a new blank database and importing everything there

    Does your code compile without errors?  You are using Option Explicit in all your modules?


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

    • Marked as answer by Marco Dell'Oca Saturday, February 8, 2020 11:14 AM
    Thursday, February 6, 2020 12:31 PM
  • Hi AccessVandal

    include "Option Explicit"?   YES

    compile the code in your VBA editor?  YES

    Any Macros ?     NO MACRO

    Naming Conventions?    NO

    I have decompiled, compacted, repaired, imported in a new database but the problem  is the same.

    This is the VBA code that is into the initial form: 

    Option Compare Database
    Option Explicit
    
    Private Sub Form_Load()
          Dim stato As Boolean
          stato = AppAlreadyUp(False, True)
          DoCmd.OpenForm "frm_server", acNormal
          DoCmd.Close acForm, Me.Name
    End Sub

    and this is the code of the function called:

    Option Compare Database
    Option Explicit
    
    Const ERROR_ALREADY_EXISTS = 183&
    
    Const GW_HWNDNEXT = 2
    Const GW_HWNDChild = 5
    
    Const SW_MAXIMIZE = 3
    Const SW_SHOWNORMAL = 1
    Const SW_SHOWMINIMIZED = 2
    Private Declare Function SetProp Lib "user32" Alias "SetPropA" (ByVal hwnd As Long, ByVal lpString As String, ByVal hdata As Long) As Long
    Private Declare Function CreateMutex Lib "kernel32" Alias "CreateMutexA" (lngMutexAttributes As Long, lngInitialOwner As Long, ByVal lpName As String) As Long
    Private Declare Function BringWindowToTop Lib "user32" (ByVal lngHWnd As Long) As Long
    Private Declare Function CloseHandle Lib "kernel32" (ByVal lnghObject As Long) As Long
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    Private Declare Function GetProp Lib "user32" Alias "GetPropA" (ByVal lngHWnd As Long, ByVal lpString As String) As Long
    Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal nRelationship As Long) As Long
    Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdSHow As Long) As Long
    Public Function AppAlreadyUp(bAllowMultipleInstances As Boolean, bDisplayMsg As Boolean) As Long
    
          Const RoutineName = "AppAlreadyUp"
          Const Version = "1.0"
     
          Dim lngMutexHandle As Long
          Dim lngHWnd As Long
          Dim lngReturn As Long
          Dim strMsg As String
     
          On Error GoTo AppAlreadyUp_Error
    
          lngMutexHandle = CreateMutex(0, 1, nomepr)
    
          If Err.LastDllError = ERROR_ALREADY_EXISTS Then
    
               If bDisplayMsg = True Then
    
                 lngReturn = CloseHandle(lngMutexHandle)
        
                 If bAllowMultipleInstances = False Then
                   strMsg = "Questo programma è già in esecuzione su questo computer."
                   strMsg = strMsg & vbCrLf & "Non è possibile aprirne una seconda copia."
                   strMsg = strMsg & vbCrLf & "Il programma verrà chiuso."
                 Else
                   strMsg = "Attenzione: Questo programma è già in esecuzione su questo computer."
                 End If
                 MsgBox strMsg, vbOKOnly + vbInformation
               End If
        
               If bAllowMultipleInstances = False Then
    
                 lngHWnd = GetWindow(GetDesktopWindow(), GW_HWNDChild)
        
                 Do While lngHWnd > 0
                   If GetProp(lngHWnd, nomepr) = 1 Then
                     BringWindowToTop (lngHWnd)
                     lngReturn = ShowWindow(lngHWnd, SW_MAXIMIZE)
                     Exit Do
                   End If
                   lngHWnd = GetWindow(lngHWnd, GW_HWNDNEXT)
                 Loop
                 esci
               End If
          Else
            lngReturn = SetProp(Application.hWndAccessApp, nomepr, 1)
          End If
     
    AppAlreadyUp_Exit:
          On Error Resume Next
    
          AppAlreadyUp = False
     
          Exit Function
     
    AppAlreadyUp_Error:
          Resume AppAlreadyUp_Exit
     
    End Function

    frm_server is the name of the form that connect to Sql Server.

    if I cancel the initial mask and insert the frm_server mask as the initial mask, the problem arises again.

    what do you think?

    Many tanks

    Marco Dell'Oca

    Friday, February 7, 2020 10:27 AM
  • Hi Daniel

    Have you tried decompiling, compact and repair, compile, compact and repair?   YES

    Have you tried creating a new blank database and importing everything there?  YES

    Does your code compile without errors?  YES

    You are using Option Explicit in all your modules?   YES

    what can I do?

    Thanks

    Marco Dell'Oca

    Friday, February 7, 2020 10:31 AM
  • Hi Daniel

    Hi Lawrence

    Hi AccessVandal

    I found the problem that doesn't allow me to create an .accde file.
    In a mask following the startup mask and the connection mask with Sql Server, which in practice is the general mask of the application, to prevent its closure, I inserted this program step:

    Private Sub Form_Unload(Cancel As Integer)
          Cancel = Not FlBoolean
    End Sub

    where FlBoolean is declared as a public variable in a module in this way:
    Public FlBoolean As Boolean

    Now if i delete this step of the program i am able to create an .accde file.

    Isn't it a little strange?

    Also if I remove this step of the program, I have to find another way to prevent closing the main form if not using the appropriate closing button of the application.
    What do you think?
    Many thanks to all

    Marco Dell'Oca

    Friday, February 7, 2020 7:37 PM
  • Also if I remove this step of the program, I have to find another way to prevent closing the main form if not using the appropriate closing button of the application.

    Hi Marco,

    You could disable the CloseButton of the application.

    Google "AccessCloseButtonDisabled" for more information.

    Imb.

    • Marked as answer by Marco Dell'Oca Saturday, February 8, 2020 11:15 AM
    Friday, February 7, 2020 8:25 PM
  • I would suggest that you hold down the shift key during startup.

    You don't really want any code running when you attempt to create a accDE.

    In other words? Well, if you have a airplane flying full of people? Well, the mechanics now can't walk out on the wings and start working on the engines etc. WHILE they are running.

    So, if timer code is running, or even some some general form is loaded and running?

    Well you can't really develop,, or do much in the way of "developer" things, and that includes compiling the application.

    Your startup code might disable certain keys, hide the ribbon - 100's and 100's of settings we often have in a typical access application.

    So, to test + run your application in "user" mode, then you just launch it, and test it out. However, when you have to change things (put your developer hat on), then you exit the application and then re-launch the application while holding down the shift key. 

    So, now the ribbon etc. and things like "special access keys", and a HUGE number of settings you have set in the startup code, and the application settings are IGNORED. You can now freely develop your application, change code, and "maybe" test some forms. But once again, to REALLY test in "user" mode, you will exit, and then re-launch the application (again without shift key) and try your  application in "user" mode.

    This shift key dance, and running your application as "user mode" - letting your startup code run etc., and then exiting and holding down the shift key to go back into developer mode will occur 100's of times in a day, and is the same basic concept as attempting to change or work on a water pump for a car, but do so WHILE it is running.

    So, for any basic requirements of developing software with Access, you CAN NOT allow your startup forms and code to run. And the same goes for attempting to create a accDE. You can ONLY achieve some progress as a developer by launching your application with the shift by-pass key, and NOT allow any code to run.

    So it not only attempting to create a accDE file can be effected by running code, but quite much near any of the development process of changing things and writing code can't occur if you allow the "many" startup settings we have in a application , and startup code to run. Just the  basic settings like "user special access keys" and stuff is 100% ignored if you launch the application with a shift key by-pass (launch holding down the shift key during startup).

    So, if you every say worked on a toaster, or a car or a electrical socket? Well, you have to turn the power off, and or turn the device off in most cases to do any work on that "thing". So, engines, appliances, power tools, and even software are all much the same - you don't want it running when you working on it.

    Try this without ANY startup code or forms or anything being allowed to run or occur when you open the application (do the sift key by-pass).

    At this point, then without access "running" and doing things, then it should allow you to create the accDE file.

    Regards,

    Albert D. Kallal (Access MVP 2003-2017)
    Edmonton, Alberta Canada


    Saturday, February 8, 2020 12:57 AM
  • You can give me a summary, I didn't understand what you mean.
    I'm sorry

    Marco Dell'Oca
    Saturday, February 8, 2020 10:29 AM
  • Hi Daniel

    Hi Lawrence

    Hi AccessVandal

    HImb-hb

    I solved my problem in this mode:

           Dim criteria As String
           criteria = SysCmd(acSysCmdRuntime)
           If criteria = "true" Then
                 Cancel = Not FlBoolean
           Else
                 Cancel = FlBoolean
           End If

    In practice I do the <cancel = not Flboolen> step only after having transformed the program into .accde.

    In this way the problem is solved.

    Thank you all

    Marco Dell'Oca

    Saturday, February 8, 2020 11:13 AM
  • Sure!

    Well, I sure you understand the concept of working on an engine while it is running is a bad idea, correct?

    I mean, if we can’t grasp the above, then we are in real trouble here!

    Ok, with the above simple concept in mind? Access has a feature for developers, and it works like this:

    You can browse to a folder, find the accDB application. Or you can launch Access first, and then use the “open” command.

    For EITHER of the above, you are to THEN hold down the shift key during start-up.

    So, say you just browsed to an accDB in a folder. Click on it one time to “highlight” (select) the accDB file (your application).

    Now, hold down the shift key – keep holding it down. Now, tap the enter key (just one tap). Like any file selected in the file explore, if you hit the enter key, then it will load + launch (it really the SAME idea as just browsing to a file, and then double clicking on that file with the mouse to launch it).

    So, keep holding down the shift key as your application (and access loads).

    WHEN you do the above?

    Then ALL of the MANY start-up features you set in access (such as those in file->options->current database are ignored.

    So your start-up code and forms will NOT run.

    And all of the settings like what form to load, custom ribbons (if you have any), and even basic settings like “show the navigation pane” etc. are 100% ignored.

    I mean, for example, if in the start-up options you have the navigation pane hidden or disabled, then how can you expect to navigate around and modify forms and reports? You simply can’t!

    However, when you deploy the application to users, you might have or want custom ribbons, or even a start-up form that allows the user to launch reports, or launch forms. And as noted, you often will provide a nice user friendly form to show + display on start-up.

    However, as a developer you don’t want all that stuff occurring on start-up. You don’t want the navigation pane hidden – since you as a developer need to use that to jump around to modify the forms and reports, and write code. However, your “end users” don’t need nor want to use the navigation pane. Your users in most cases will not have a clue as to what report, or form to launch. So you the developer no doubt provided some nice user friendly forms to launch on start-up to provide the users will a great and easy to use experience for the application you developed.

    So, the concept here is:

    You build and design your application with users in mind.

    You no doubt have all kinds of things that occur on start-up, say like setting a particular form to display on start-up.

    If you ever used any software on a computer, I sure you grasp this concept that the software will no doubt present the user with some options and features to use your great program you developed with Access.

    However, WHEN you the developer is working on the application, you are the software developer. You don’t need nor want some user friendly form to launch on start-up. You as a developer don’t want the navigation pane hidden. You as a developer don’t want the special “access keys” disable. (I could write on for another 100+ pages here as to this obviously issue: That obvious issue that what the developer needs and wants on application start-up is significant different goal then what your end users need.

    As a developer, in near 99% of cases, you do NOT want ANY of the application parts to start up and run, as this will prevent you the developer from working on the guts of the application.

    You can also browse to a folder, click once on the application. And then hold down the shift key, and then WHILE STILL holding down the shift key, you can double click with the mouse to launch the application. As noted, if you KEEP holding down the shift key during application start-up, then ALL OF the start-up setting are disabled. So, no code or forms will launch, and all of the application start-up settings are 100% disabled and ignored.

    So, you need this basic skill set to work with Access. It really not any different of a concept of working on your car, but you would never work on the car while it is running. However, just like you might run the engine with some test equipped say to set the idle speed of the car? Well, then of course you as a developer will often run + test some code. In a lot of cases you might just from the navigation pane launch a form to test how it looks, and how the code runs. However, as an application grows in size, then often the form you launch requires some previous form to have been loaded, and many VBA variables etc. having been set. So, you often find that as a developer, you need all that previous code and forms loaded. So, often, you have to simply save your work, exit Access, and then re-launch the application in “user mode”. That means you do not use the shift key by-pass on start-up. That will now allow all your settings and start-up code to run. If everything is fine, then you are finally ready to create the compiled “accDE” version of the appcation. This of course is your “final” step before deploying your great application to your end users. (The people that will run and use your great application you and your software team built).

    So, now put your developer hat back on. And launch the application WITHOUT any start-up code running. It is at this point in time you should be able to freely create the accDE file, and do so without the application “running” or having attempted to run all kinds of start-up code that can VERY much interfere with your developer goals.

    So, now that you grasped this simple ad basic developer concept?

    Then it is a simple matter to launch the application using the above shift key by-pass concept. And thus you should without issue be able to create the accDE file without issues.

    The best way to grasp this concept is to think of how difficult it would be for a mechanic to work on an aircraft engine while the plane is in flight full of passengers. I think you agree that such an idea does not make sense, and the same reasoning and logic applies to developing with Access. So, attempting to create a accDE “while” the application is running, or all that start-up code has run is simply a bad idea, and you find a LONG list of things that will interfere with your ability to developer software in Access if you have all those bits and parts running or even having attempted to run while you need to change and develop your software.

    Regards,

    Albert D. Kallal (Access MVP 2003-2017)

    Edmonton, Alberta Canada

    Saturday, February 8, 2020 9:08 PM