>The docs go out of there way to stress that this is NOT the DB local
>ID but the application's local ID. They go on to confuse me by providing
>me with an example code snippet as follows:
>
>DmGetNextDatabaseByTypeCreator (true,&searchInfo,sysFileTApplication,
>sysFileCDatebook, true,&cardNo, &dbID);
>AlmSetAlarm (cardNo, dbID, ref, alarmTime,true);

Right: this is getting the local id of the datebook application.  (Note the
"sysFileTApplication" parameter.) This is code out of the Datebook
application, although there's another way to do it: SysCurAppDatabase()
tells you about the currently running app, which will be you.


>1) How do I get my application's local ID?

SysCurAppDatabase().  Or use any of the Data Manager functions which look
for a database given its name and/or creator ID and type.


>2) What is this weird connection between databases and applications?

Every application is a database.  In fact every piece of data that doesn't
vanish when you hit the reset button is in a database: either a record
database (usually used for data) or a resource database (apps are always
resource databases, but they can also be used for data).

Instead of "database", think "structured file", if that helps.  On a PC,
everything is stored in a file.  On Palm OS everything is stored in
databases, and there's more to them than just being files, and so they're
called something different.  Perhaps they shouldn't have been called
databases since people start thinking of SQL, but that's life.

-David Fedor
Palm Developer Support

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to