You can check the sysAppLaunchFlagSubCall flag in your launch flags to determine whether your app is running already. If it is, you can access globals, including a global that contains a DmOpenRef. If it isn't, you can open the database safely, knowing that your app isn't running. This is a common pattern in Palm OS apps; see the sample code for examples.
As Peter said, you don't have to worry about your app starting up or quitting while you're handling the sysAppLaunchCmdAlarmTriggered sublaunch. It's all running in the same thread. There are a few places where you have to deal with concurrency, but they're noted in the documentation. For example, serial wakeup handlers are called from an interrupt service routine. - Danny -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
