How can I run MS Access program automatically from the startup, show it in sys tray

accesser2003

Registered User.
Local time
Today, 18:59
Joined
Jun 2, 2007
Messages
124
I developed a program. Would you please teach me how to run it automatically when the computer restarted, through the startup.

Plus this I want to let this program run through the system tray, and not shown in the the Taskbar, if this feature is provided by MS Access 2003

Thankful...
 
For the startup, you can just drag the MDB into the StartUp folder. For getting it to be a SysTray icon, you're on your own. There's nothing built-in to do that. You can check the "Do Not Show In Taskbar" option in Access (Tools -> Options -> View tab), but it will take something third party to make it a SysTray icon.
 
Thanks for answering:

1. I am running in Windows XP OS, would you tell me the exact folder, that by moving to which I can run in the startup.

2. There is no API to run it using the system tray?

Highly appreciative.
 
For the Startup folder, it's different on every machine. If you go to Start -> Programs, you should see a folder in there called Startup. That's it. If it's not there, the path is usually along these lines:

C:\Documents and Settings\<userloginIDhere>\Start Menu\Programs\Startup

As for an API to place an icon in the SysTray, if it does exist, I've not seen it, at least for Access. That doesn't mean that one doesn't exist; rather, it just means I've never had a need for it/looked for it, etc.
 
Do not move Access to the startup folder.

Create an Icon that runs your application. If necessary, edit the icon with the command line options you might need for it. Access Help will show you what you need to know about command line options. Then create a shortcut to the desired MDB file. Then copy that shortcut (CTRL/C type of copy or right-click and select "Copy" - that sort of thing). Then right-click on the start button and left-click on EXPLORE ALL USERS. Find the "ALL USERS" tree under Documents and Settings, where you see "Start Menu" >> "Programs" >> "Startup" as a path to a folder with other icons that also are started for all users. Paste the shortcut you copied earlier into the startup folder for "all users."

ALTERNATIVE: If this is selective and multiple users have access to the same computer, find that path for each individual user to whom this applies and paste that shortcut icon in each per-user startup folder.

Be warned that this has the potential to annoy the living crap out of your user base. Particularly if you are using a shared backend or a shared MDB file that you have secured. Because in that case, you might end up forcing a user to log in to the machine a second time. (Once for windows; once for your application.)

Your question is simple enough. Startup is easy. But if you have started the database in the background, to drop it to the sys tray says it will never exit. I would be EXTREMELY wary of this as it implies you ALSO have to start an orderly shutdown of Access if you want to reboot the machine, which will be an issue to consider. And if you DON'T do the orderly shutdown, the odds greatly favor that you will quickly corrupt the database in question.

FURTHER, Access is capable of REJECTING a QUIT command if it happens to be doing something at the time. Which means your user will get the dreaded "This application is not responding ...." dialog that has the button on it that says "End Now" - and bang/zoom, there goes any chance of maintaining file integrity because you will be doing a disorderly close of the application. A disorderly close has a virtual CERTAINTY of corrupting your application files within a week unless you are one of the damndest prograrmmers we've ever seen around here.

So we've told you how to screw yourself really well. But I would be remiss in my obligation if I didn't also warn you that a screw job is imminent.
 
Heh...

Thanks for the forewarning Doc. I didn't mean to put Access itself in the setup, but a shortcut to the DB itself as you've suggested. I hope I wasn't misleading with that.

As for the SysTray stuff, VB.NET will do that (along with a right-click "Exit" option), but it sounds like you're agreeing with me in that the SysTray functionality for Access is third party (if it exists) and well, the payoff will not beat the potential complete corruption/screwed state of the DB.
 
Yup, we agree, Moniker. Leaving a DB open isn't for the faint of heart.
 

Users who are viewing this thread

Back
Top Bottom