Slide 10.10: DB.c
  Slide 10.12: Line-by-line anatomy of DB.c (cont.)
  Home


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.
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. For the following parameters, pass NULL if you do not want to retrieve this information.