RDbNamedDatabase Class Reference

class RDbNamedDatabase : public RDbDatabase

Generic database implementation

Inherits from

  • RDbNamedDatabase

    Member Functions Documentation

    Create(RDbs &, const TDesC &, const TDesC &)

    IMPORT_C TIntCreate(RDbs &aDbs,
    const TDesC &aDatabase,
    const TDesC &aFormat
    )

    Creates a secure shared database. Max allowed database name length (with the extension) is KDbMaxName symbols.

    In this "client-server" mode the database can be shared with the other clients.

    For creating a non-secure database, see RDbNamedDatabase::Create(), which first argument is a RFs reference (or RDbNamedDatabase::Replace()).

    capability
    Note For a secure shared database, the caller must satisfy the schema access policy for the database.
    RDbNamedDatabase::Create(RFs& aFs, const TDesC& aSource, const TDesC& aFormat) RDbNamedDatabase::Replace(RFs& aFs, const TDesC& aSource, const TDesC& aFormat)

    Parameters

    RDbs & aDbsA reference to DBMS session instance.
    const TDesC & aDatabaseDatabase name. The name format is: <drive>:<name>.<ext>
    const TDesC & aFormatDatabase format string. The string format is: "SECURE[UID]", where UID is the database security policy UID. "SECURE" keyword is case insensitive.

    Open(RFs &, const TDesC &, const TDesC &, TAccess)

    IMPORT_C TIntOpen(RFs &aFs,
    const TDesC &aDatabase,
    const TDesC &aFormat =  TPtrC(),
    TAccessaMode = EReadWrite
    )

    Parameters

    RFs & aFs
    const TDesC & aDatabase
    const TDesC & aFormat =  TPtrC()
    TAccess aMode = EReadWrite

    Open(RDbs &, const TDesC &, const TDesC &)

    IMPORT_C TIntOpen(RDbs &aDbs,
    const TDesC &aDatabase,
    const TDesC &aFormat =  TPtrC()
    )

    Parameters

    RDbs & aDbs
    const TDesC & aDatabase
    const TDesC & aFormat =  TPtrC()

    Replace(RFs &, const TDesC &, const TDesC &)

    IMPORT_C TIntReplace(RFs &aFs,
    const TDesC &aDatabase,
    const TDesC &aFormat =  TPtrC()
    )

    Creates a new non-secure database. If a database with the same file name exists, it will be replased.

    In this "single client" mode, the database cannot be shared with the other clients. The database server is not involved in the operations with the database, the client side database library (edbms.dll) will be used. If the database has to be shared, the following example shows how this may be accomplished:
    RFs fs;
    TInt err = fs.Connect();
    <process the error>
    _LIT(KDatabaseName, _L("C:\\A.DB"));
    RDbNamedDatabase db;
    err = db.Replace(fs, KDatabaseName);	//Step 1 - create the database using the RFs object
    <process the error>
    db.Close();								//Step 2 - close the database
    RDbs dbs;
    err = dbs.Connect();
    <process the error>
    err = db.Open(dbs, KDatabaseName);		//Step 3 - reopen the database using the RDbs object
    <process the error>
    ...

    Max allowed database name length (with the extension) is KDbMaxName symbols.

    For creating a new secure shared database, see RDbNamedDatabase::Create(), which first argument is a RDbs reference.

    RDbNamedDatabase::Create(RDbs& aDbs, const TDesC& aDatabase, const TDesC& aFormat)

    Parameters

    RFs & aFsHandle to a file server session.
    const TDesC & aDatabaseDatabase name. The name format is: <drive>:<path><name>.<ext>
    const TDesC & aFormat =  TPtrC()Database format string. It can be omitted in which case the default parameter value (TPtrC()) will be used.

    Member Enumerations Documentation

    Enum TAccess

    Specifies which operations can be performed on a rowset.

    Enumerators

    EReadWrite
    EReadOnly

    Row navigation and reading are permitted.