Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: d32dbms.h
Link against: edbms.lib

Class RDbNamedDatabase

RDbNamedDatabase

Support

Supported from 5.0

Description

The interface for creating and opening a database identified by name and format.

For exclusive read/write or shared read/only access, the database is accessed on the client side through a file server session. For shared read/write access, the database must be accessed through a DBMS server session.

Derivation

RDbDatabaseAbstract class providing the functionality of a database
RDbNamedDatabaseThe interface for creating and opening a database identified by name and format

Defined in RDbNamedDatabase:
Create(), EReadOnly, EReadWrite, Open(), Replace(), TAccess

Inherited from RDbDatabase:
AlterTable(), Begin(), ChangeSecurity(), Close(), ColSetL(), Commit(), Compact(), CreateIndex(), CreateTable(), Destroy(), DropIndex(), DropTable(), Execute(), InTransaction(), IndexNamesL(), IsDamaged(), KeyL(), Recover(), Rollback(), Size(), TSize, TableNamesL(), UpdateStats()


Create a database


Create()

TInt Create(RFs& aFs,const TDesC& aDatabase,const TDesC& aFormat=TPtrC(),CSecurityEncryptBase* aKey=0);

Description

Creates a new database using the supplied format specification. The database must not already exist, otherwise the function fails.

On successful return, the database is open for exclusive read/write access by the client.

This function initiates client-side access to the database through a file server session and does not require a connection to the DBMS server.

Parameters

RFs& aFs

A reference to a file server session through which the database is accessed.

const TDesC& aDatabase

A reference to a descriptor containing the name of the database.

const TDesC& aFormat=TPtrC()

A reference to a descriptor containing the format name of the database. The default format implies a Store database in the root stream of the named file.

CSecurityEncryptBase* aKey

A pointer to an encryption key (as returned , for example, from a call to CSecurityBase::NewEncryptL()). This is used to create authentication data in the database. The default value is NULL and implies an unencrypted database.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


Replace()

TInt Replace(RFs& aFs,const TDesC& aDatabase,const TDesC& aFormat=TPtrC(),CSecurityEncryptBase* aKey=0);

Description

Creates a database using the supplied format specification and replaces any existing database with the same name. On successful return, the database is open for exclusive read/write access by the client.

This function initiates client-side access to the database through a file server session and does not require a connection to the DBMS server.

Parameters

RFs& aFs

A reference to a file server session through which the database is accessed.

const TDesC& aDatabase

A reference to a descriptor containing the name of the database.

const TDesC& aFormat

A reference to a descriptor containing the format name of the database. The default format implies a Store database in the root stream of the named file.

CSecurityEncryptBase* aKey

A pointer to an encryption key (as returned , for example, from a call to CSecurityBase::NewEncryptL()); this is used to create authentication data in the database The default value is NULL and implies an unencrypted database.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.

[Top]


Open a database


Open()

TInt Open(RFs& aFs,const TDesC& aDatabase,const TDesC& aFormat=TPtrC(),CSecurityDecryptBase* aKey=0,TAccess aMode=EReadWrite);

Description

Opens a database for client side access using the supplied format specification. On successful return, the database is open for either exclusive read/write access or shared read/only access by the client, as determined by the file access mode aMode.

This function initiates client-side access to the database through a file server session and does not require a connection to the DBMS server.

Parameters

RFs& aFs

A reference to a file server session through which the database is accessed.

const TDesC& aDatabase

The name of the database.

const TDesC& aFormat

The format name of the database. The default format implies a Store database in the root stream of the named file.

CSecurityDecryptBase* aKey

A pointer to a decryption key which should match the database encryption key. The default value is NULL and implies an unencrypted database.

TAccess aMode

The access mode. The default is exclusive read/write mode.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.


Open()

TInt Open(RDbs& aDbs,const TDesC& aDatabase,const TDesC& aFormat=TPtrC(),CSecurityDecryptBase* aKey=0);

Description

Opens a database, using the supplied format specification, through a DBMS server session.

On successful return, the database can be shared by multiple threads where at least one of them needs write access.

Parameters

RDbs& aDbs

A reference to a session with the DBMS through which the database is accessed.

const TDesC& aDatabase

The name of the database.

const TDesC& aFormat

The format name of the database. The default format implies a Store database in the root stream of the named file.

CSecurityDecryptBase* aKey

A pointer to a decryption key which should match the database encryption key. The default value is NULL and implies an unencrypted database.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.

[Top]


Enumerations


Enum TAccess

TAccess

Description

Defines the required access mode when opening a database for client side access through a file server session.

EReadWrite

The database is to be opened in exclusive read/write mode.

EReadOnly

The database is to be opened in shared read-only mode.