Line-by-line Anatomy of DB.c
Err retcode = 0;
Err
is an error code.
DmOpenDatabaseByTypeCreator( DBType, CreatorID, dmModeReadWrite | dmModeShowSecret )
This function DmOpenRef DmOpenDatabaseByTypeCreator( UInt32 type, UInt32 creator, UInt16 mode ) opens the most recent revision of a database with the given type and creator.
If the database could not be found, this function returns 0 and DmGetLastErr( ) returns an error code indicating the reason for failure.
type
: Type of database
creator
: Creator of database
mode
: Which mode to open database in (see “Open Mode Constants”)
DmOpenDatabaseInfo( db, &dbID, NULL, NULL, &dbCard, NULL );
This function Err DmOpenDatabaseInfo( DmOpenRef dbP, LocalID *dbIDP, UInt16 *openCountP, UInt16 *modeP, UInt16 *cardNoP, Boolean *resDBP ) retrieves information about an open database.
Returns errNone
if no error.
dbP
:
DmOpenRef
to open database
For the following parameters, pass NULL
if you do not want to retrieve this information.
dbIDP
:
The ID of the database
openCountP
:
The number of applications that have this database open
modeP
:
The mode used to open the database (see “Open Mode Constants.”)
cardNoP
:
The number of the card on which this database resides
resDBP
:
If true
upon return, the database is a resource database, false
otherwise.