| class RDbNamedDatabase : public RDbDatabase |
Generic database implementation
| Public Member Functions | |
|---|---|
| IMPORT_C TInt | Create ( RDbs &, const TDesC &, const TDesC &) |
| IMPORT_C TInt | Open ( RFs &, const TDesC &, const TDesC &, TAccess ) |
| IMPORT_C TInt | Open ( RDbs &, const TDesC &, const TDesC &) |
| IMPORT_C TInt | Replace ( RFs &, const TDesC &, const TDesC &) |
| Inherited Functions | |
|---|---|
| RDbDatabase::AlterTable(const TDesC &,const CDbColSet &) | |
| RDbDatabase::Begin() | |
| RDbDatabase::Close() | |
| RDbDatabase::ColSetL(const TDesC &)const | |
| RDbDatabase::Commit() | |
| RDbDatabase::Compact() | |
| RDbDatabase::CreateIndex(const TDesC &,const TDesC &,const CDbKey &) | |
| RDbDatabase::CreateTable(const TDesC &,const CDbColSet &) | |
| RDbDatabase::CreateTable(const TDesC &,const CDbColSet &,const CDbKey &) | |
| RDbDatabase::Destroy() | |
| RDbDatabase::DropIndex(const TDesC &,const TDesC &) | |
| RDbDatabase::DropTable(const TDesC &) | |
| RDbDatabase::Execute(const TDesC &,TDbTextComparison) | |
| RDbDatabase::InTransaction()const | |
| RDbDatabase::IndexNamesL(const TDesC &)const | |
| RDbDatabase::IsDamaged()const | |
| RDbDatabase::KeyL(const TDesC &,const TDesC &)const | |
| RDbDatabase::Recover() | |
| RDbDatabase::Rollback() | |
| RDbDatabase::Size()const | |
| RDbDatabase::TableNamesL()const | |
| RDbDatabase::UpdateStats() | |
| Public Member Enumerations | |
|---|---|
| enum | TAccess { EReadWrite , EReadOnly } |
| Inherited Attributes | |
|---|---|
| RDbDatabase::iDatabase | |
| IMPORT_C TInt | Create | ( | 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() ).
| RDbs & aDbs | A reference to DBMS session instance. |
| const TDesC & aDatabase | Database name. The name format is: <drive>:<name>.<ext> |
| const TDesC & aFormat | Database format string. The string format is: "SECURE[UID]", where UID is the database security policy UID. "SECURE" keyword is case insensitive. |
| IMPORT_C TInt | Open | ( | RFs & | aFs, |
| const TDesC & | aDatabase, | |||
| const TDesC & | aFormat = TPtrC (), | |||
| TAccess | aMode = EReadWrite | |||
| ) | ||||
| IMPORT_C TInt | Open | ( | RDbs & | aDbs, |
| const TDesC & | aDatabase, | |||
| const TDesC & | aFormat = TPtrC () | |||
| ) | ||||
| IMPORT_C TInt | Replace | ( | 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.
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)
Specifies which operations can be performed on a rowset.
| EReadWrite | |
| EReadOnly |
Row navigation and reading are permitted. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.