473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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
Expand|Select|Wrap|Line Numbers
  1. ::/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
Dec 6 '11 #1

✓ answered by NeoPa

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.

10 27481
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
Dec 6 '11 #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
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
Dec 6 '11 #3
ADezii
8,834 Expert 8TB
The following will create a Shortcut on the Desktop named Test Database.lnk, pointing to the Database C:\Stuff\Test.mdb, with the Icon of C:\Test\Test.ico. The Code can easily be more portable by encapsulating it in a Sub-Routine/Function, and passing it several Arguments.
Expand|Select|Wrap|Line Numbers
  1. With CreateObject("WScript.Shell")
  2.   With .CreateShortcut(.SpecialFolders("Desktop") & "\Test Database.lnk")
  3.     .TargetPath = "C:\Stuff\Test.mdb"
  4.     .WindowStyle = 1
  5.     .Hotkey = ""
  6.     .IconLocation = "C:\Test\Test.ico, 0"
  7.     .Description = "Test Icon Substitution"
  8.     .WorkingDirectory = "C:\Stuff\"
  9.       .Save
  10.   End With
  11. End With
Dec 6 '11 #4
NeoPa
32,556 Expert Mod 16PB
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.
Dec 9 '11 #5
sierra7
446 Expert 256MB
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 programmatically 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
Dec 9 '11 #6
sierra7
446 Expert 256MB
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
Dec 9 '11 #7
NeoPa
32,556 Expert Mod 16PB
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.
Dec 9 '11 #8
ADezii
8,834 Expert 8TB
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.
Dec 9 '11 #9
NeoPa
32,556 Expert Mod 16PB
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 :-)
Dec 9 '11 #10
ADezii
8,834 Expert 8TB
@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.
Dec 9 '11 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Eskimo Joe | last post by:
I am trying to create a desktop icon using VB6. is this possible? -p
1
by: Bodi | last post by:
Hello, Could someone please tell me if there is a way, or how do I change my html/javascript so that if I drag and drop a link from a webpage to the desktop in such a way that the name of the...
3
by: Giloosh | last post by:
Hello, i have a microsoft access application and right now, anyone knowing how to use microsoft-access can easily go behind the applicatio, design the forms, delete edit/tables etc... There is...
4
by: blagdam | last post by:
Is it possible to launch a functional Access 2000 db switchboard by clicking on a desktop icon? I have searched the Microsoft Knowlege Base but, apparently I'm not phrasing my search in the...
2
by: Rohit Chaphekar | last post by:
How do I change the icon for an application? I tried setting the Icon property but it does not seem to work. Thanks, Rohit
1
by: | last post by:
I need to let the user know what state a certain property had the last time the program was run. Is there a way to have the application itself change the desktop icon used to start the program. I...
3
by: MLH | last post by:
I would like to launch an A97 runtime application, doing one additional thing immediately prior to launching. Here's the Target property setting of the desktop icon I now use to launch the...
3
by: VANWEB | last post by:
A developer gave me a Microsoft Access Application approximately 42MB that I had him design. I can open the application itself and see the Access GUI with the buttons & menu he created, but I...
0
by: Steve | last post by:
After installing my application (which I developed using Visual Studio 2005) on a target desktop, the desktop icon shows the icon that is assigned to the application exe - which is what I want. ...
2
by: Lysander | last post by:
This is a strange one. I am running MS-Access 2003, under Windows XP and have many desktop shortcuts, used to pick up the correct mdw file. An example would be called "Champion System" and have...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.