Opens the database object associated with the identifier.
Returns a smart pointer to the opened object if successful, otherwise returns NULL.
openMode must be one of the following: