Changing the desktop icon of a Microsoft Access application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Craig420
    New Member
    • Nov 2011
    • 4

    Changing the desktop icon of a Microsoft Access application

    Hey All,
    I hate it when my first post on a forum is me asking a question but it is a pretty simple question which I just cannot work out.
    The title of this post explains all; basically I need to change the icon of an Access Database (.mdb) from the default pinkish colored Microsoft one.
    I am aware that I could perhaps create a shortcut and change the icon for this due the nature of the dynamically remapping cluster which the Shortcut will be stored on this cannot be done.
    After some reading, I did find where windows icons are stored
    Code:
    ::/Windows/System32/Shell32.dll
    This obviously is a dll file so I can not just open it and paste in our replacement icon then somehow add it to Access that way.
    I did find some software which allows you to open the .dll and display the icons inside, which I think you can edit and also add your own, but I do not see a way to save this back as a .dll, only as a .ico.

    I did not think this would be so hard.
    Thanks in advance,
    -Craig
  • samiiix
    New Member
    • Dec 2011
    • 1

    #2
    you don't need to save it as dll. in the dll it is only stored which ico to use.
    In fact you may use any image for a application as icon

    Comment

    • Craig420
      New Member
      • Nov 2011
      • 4

      #3
      you don't need to save it as dll. in the dll it is only stored which ico to use.
      In fact you may use any image for a application as icon
      Yes, but how would I get the 32x32 image of our logo I created (saved as .ico) to be used as the icon for the Microsoft Access MDB file?
      I dont see an option to change icon?
      Only to create a shortcut then change the icon for that, but as I explained this is not possible.
      Also, even if it was, my created logo is not in the selection list, only the icons stored in Shell32.dll. How would I add my 32x32.ICO file to this list?
      Thanks for your reply, it is very much appreciated.
      -Craig

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        The following will create a Shortcut on the Desktop named Test Database.lnk, pointing to the Database C:\Stuff\Test.m db, with the Icon of C:\Test\Test.ic o. The Code can easily be more portable by encapsulating it in a Sub-Routine/Function, and passing it several Arguments.
        Code:
        With CreateObject("WScript.Shell")
          With .CreateShortcut(.SpecialFolders("Desktop") & "\Test Database.lnk")
            .TargetPath = "C:\Stuff\Test.mdb"
            .WindowStyle = 1
            .Hotkey = ""
            .IconLocation = "C:\Test\Test.ico, 0"
            .Description = "Test Icon Substitution"
            .WorkingDirectory = "C:\Stuff\"
              .Save
          End With
        End With

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32661

          #5
          Have you looked in Tools | Startup yet? There is a property there which allows you to set the icon. I've never used it myself, but I expect it's what you're after.

          Comment

          • sierra7
            Recognized Expert Contributor
            • Sep 2007
            • 446

            #6
            Hi
            NeoPa, if you try this you with probably find that the icon selected only appears as a tiny representation in the top LH corner of your open Access application. (In Access 2010 select File to go backstage then select Options, Current Database, Application Icon, Browse, OK, OK then restart)

            When I first tried this in 2000 I had expected my Access app to display my icon in Windows Explorer. However, it seems that only .exe files , & maybe others, are interpreted this way but a good-old .mdb file is just shown with an Access 'key' icon.

            My solution was to attach the icon to a desktop shortcut as has already been described.

            ADezzi, I like your idea of programmaticall y creating the shortcut. I shall look to running it from my startup form. I shall need to test whether it automatically over-writes an existing shortcut or whether I need to test it exists first before attempting creation. Have you tried this?

            S7

            Comment

            • sierra7
              Recognized Expert Contributor
              • Sep 2007
              • 446

              #7
              ADezii,
              Thanks, that works great!

              No need to check one already exist either.

              I'm not sure I understand the code. I did not have a reference to Windows Scripting Runtime in the Test system I used but it ran OK anyway.

              Thanks again for the tip.

              S7

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32661

                #8
                There are two different approaches here :
                1. Changing the icon that shows when viewing the file in Windows Explorer for instance.
                2. Changing or creating a shortcut to this database which shows a different icon.


                The first is handled by the File Associations in Windows. Any such change here would necessarily pertain to all such files recognised by extension as MDB, so cannot practically be achieved.

                The second can be managed by ADezii's code, but it is also possible to create and modify such shortcuts manually. To modify an existing shortcut simply select it and choose Properties (Right-click wherever it's found but Alt-Enter if selectable - for instance from Windows Explorer). When the Properties window is open (You should find yourself in the Shortcut tab.) click on Change Icon and use the following screen to choose both the file the icon is held within as well as the particular icon in that file.

                Comment

                • ADezii
                  Recognized Expert Expert
                  • Apr 2006
                  • 8834

                  #9
                  Request as stated by the Original Poster [OP]:
                  I am aware that I could perhaps create a shortcut and change the icon for this due the nature of the dynamically remapping cluster which the Shortcut will be stored on this cannot be done.

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32661

                    #10
                    You're absolutely right ADezii. I must admit to finding it quite uncomfortable trying to make sense of English written without consideration for grammar and important words simply left out, but if I look at it again, it does indicate the OP is not after a manual solution. Your (clever) code is required after-all :-)

                    Comment

                    • ADezii
                      Recognized Expert Expert
                      • Apr 2006
                      • 8834

                      #11
                      @sierra7:
                      I did not have a reference to Windows Scripting Runtime in the Test system I used but it ran OK anyway.
                      This Reference is not required.

                      Comment

                      Working...