Symbian
 Developer Library

DEVELOPER LIBRARY

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



Location: commdb.h
Link against: commdb.lib

Class CCommsDatabase

class CCommsDatabase : public CCommsDatabaseBase;

Support

Supported from 5.0

Description

Accesses the communications database through the DBMS.

An object of this type must be constructed and opened by a client before any of the tables in the database can be accessed.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CCommsDatabaseAccesses the communications database through the DBMS
CCommsDatabaseBaseBase class for CCommsDatabase

Defined in CCommsDatabase:
BeginTransaction(), CCommsDatabase(), CancelRequestNotification(), ClearAgentAndExtL(), ClearGlobalSettingL(), Close(), CloseDatabase(), CommitTransaction(), CreateDatabaseL(), DoClearCompatibilitySettingL(), DoFindConnectionPrefLC(), DoGetCompatibilitySettingL(), DoGetCurrentSettingL(), DoOpenAgentTableLC(), DoOpenConnectionPrefViewLC(), DoOpenL(), DoSetCompatibilitySettingL(), DoSetGlobalSettingL(), DoSetGlobalSettingL(), DoSetIAPCompatibilitySettingL(), ECompatibilitySetting, EGlobalSetting, ENotASetting, GetAgentClientTimeoutL(), GetAgentDesL(), GetAgentExtL(), GetAgentL(), GetAgentRouteTimeoutL(), GetAgentTimeoutL(), GetClientTimeoutL(), GetCurrentDialInSettingL(), GetCurrentDialOutSettingL(), GetDefaultRecordL(), GetGlobalSettingL(), GetGlobalSettingL(), GetRouteTimeoutL(), GlobalSettingTypeL(), InTransaction(), NewL(), NewL(), NewL(), NewL(), Open(), OpenConnectionPrefTableInRankOrderLC(), OpenConnectionPrefTableLC(), OpenConnectionPrefTableLC(), OpenConnectionPrefTableViewOnRankLC(), OpenDefaultDbL(), OpenGlobalSettingsTableLC(), OpenIAPTableViewMatchingBearerSetLC(), OpenTableLC(), OpenViewLC(), OpenViewMatchingBoolLC(), OpenViewMatchingTextLC(), OpenViewMatchingTextLC(), OpenViewMatchingUintLC(), OpenViewOnProxyRecordLC(), RequestNotification(), ResolvePhoneNumberFromDatabaseL(), ResolvePhoneNumberL(), RollbackTransaction(), SetAgentClientTimeoutL(), SetAgentDesL(), SetAgentExtL(), SetAgentL(), SetAgentRouteTimeoutL(), SetAgentTimeoutL(), SetClientTimeoutL(), SetDefaultRecordL(), SetGlobalSettingL(), SetGlobalSettingL(), SetRouteTimeoutL(), ShowHiddenRecords(), TGlobalSettingType, Type(), ValidateRankL(), ValidateServiceL(), ~CCommsDatabase()

Inherited from CBase:
operator new()

Inherited from CCommsDatabaseBase:
BeginInternalTransactionL(), CommitInternalTransaction(), ConvertToUid(), Database(), DatabaseUpdateHasOccurred(), DoClose(), DoOpenIAPTableViewL(), DoOpenTableViewL(), DoOpenViewMatchingTextL(), DoOpenViewMatchingUintL(), GetRandomNumber(), IsDatabaseWriteLockedL(), NotifyAllChanges(), NotifyChangeL(), PopulateChargeCardL(), PopulateDialLocationL(), RollbackInternalTransaction(), TCommDbSystemAgentNotification, Version(), iDatabase, iDbs, iInInternalTransaction, iNotifications, iNotifier, iNotifierOpenError, iShowHiddenRecords, iSystemAgent, iSystemAgentNotifier, iUid, iUpdateHasOccurred, iValue


Construction and destruction


NewL()

static CCommsDatabase* NewL();

Support

Withdrawn in 6.0
Supported from 7.0

Description

Allocates and constructs a new communications database object on the heap.If the database filestore does not exist the default filestore is duplicated. If no default filestore exists an empty database is created.

If there is insufficient memory available to create the object, the function leaves. If allocation is successful, it returns a pointer to the new object.

Return value

CCommsDatabase*

A pointer to a communications database object .


NewL()

static CCommsDatabase* NewL(TBool aUseDefaultDb);

Support

Supported from 7.0

Description

Creates a CCommsDatabase. If the database filestore exists and aUseDefaultDb is ETrue the default filestore is duplicated. Otherwise an empty database is created. If the commdb doesn't exist and this and aUseDefaultDb is EFalse the this function will leave.

Parameters

TBool aUseDefaultDb

Use the default database.

Return value

CCommsDatabase *

A pointer to a communications database object.

Leave codes

KErrNotSupported

when aUseDefaultDb is EFalse and the database filestore does not exists.


NewL()

static CCommsDatabase* NewL(TCommDbOpeningMethod& aOpeningMethod);

Support

Supported from 7.0

Description

Creates a CCommsDatabase as with NewL(). The method of opening: (Created, CopiedDefault or Opened) is returned in aOpeningMethod.

Parameters

TCommDbOpeningMethod& aOpeningMethod

On return, the opening method.

Return value

CCommsDatabase *

A pointer to a communications database object.


NewL()

static CCommsDatabase* NewL(TCommDbDatabaseType aType);

Support

Supported from 6.0
Withdrawn in 7.0

Description

Allocates and constructs a new communications database object on the heap.

The function creates the directory for the database file and creates a database with empty tables if there is no existing database. It also connects the DBMS server and opens the database for shared access. It leaves with an error if the database and server are not opened successfully. The error can be any error returned by calls to the file server or the DBMS server.

The database and the connection to the server are closed on deletion of all instantiations of CCommsDatabase.

The aType parameter indicates the type of database the client is expecting to open. The two types are:

These two types cannot co-exist: any particular database is of one type or the other. If the client knows which type of database it wants to open, then it should use the appropriate parameter. If on the other hand it does not mind which type the database is, it can specify the type as unknown. Note, however, that if the type is unknown, a database must already exist. If not, the type must be specified.

Parameters

TCommDbDatabaseType aType

Type of database

Return value

CCommsDatabase*

A pointer to a communications database object


~CCommsDatabase()

~CCommsDatabase();

Support

Supported from 6.0

Description

Frees all resources owned by this object, prior to its destruction.

In particular, the destructor closes the communications database and disconnects from the DBMS.

[Top]


Global settings


GetGlobalSettingL()

void GetGlobalSettingL(const TDesC& aSetting, TUint32& aValue);

Support

Supported from 6.0

Description

Gets a global settings table integer field.

Parameters

const TDesC& aSetting

Setting to get

TUint32& aValue

On return, setting value

Leave codes

KErrNotSupported

aSetting is invalid

KErrNotFound

The global setting has not been set

Notes:


GetGlobalSettingL()

void GetGlobalSettingL(const TDesC& aSetting, TDes& aValue);

Support

Supported from 6.0

Description

Gets a global settings table string field.

Parameters

const TDesC& aSetting

Setting to get

TDes& aValue

On return, setting value

Leave codes

KErrNotSupported

aSetting is invalid

KErrNotFound

The global setting has not been set


SetGlobalSettingL()

void SetGlobalSettingL(const TDesC& aSetting, TUint32 aValue);

Support

Supported from 6.0

Description

Sets a global settings table integer field.

Parameters

const TDesC& aSetting

Setting to get.

TUint32 aValue

Setting value.

Leave codes

KErrNotSupported

aSetting is invalid.

Notes:


SetGlobalSettingL()

void SetGlobalSettingL(const TDesC& aSetting, const TDesC& aValue);

Support

Supported from 6.0

Description

Sets a global settings table string field.

Parameters

const TDesC& aSetting

Setting to get.

const TDesC& aValue

Setting value.

Leave codes

KErrNotSupported

aSetting is invalid.


ClearGlobalSettingL()

void ClearGlobalSettingL(const TDesC& aSetting);

Support

Supported from 6.0

Description

Clears a global settings table field.

Parameters

const TDesC& aSetting

Setting to clear.

Leave codes

KErrNotSupported

aSetting is invalid

[Top]


Simple access to dial settings


GetCurrentDialOutSettingL()

void GetCurrentDialOutSettingL(const TDesC& aSetting, TUint32& aValue);

Support

Supported from 6.0

Description

Gets the default ISP, location or modem for dial-out. This function is not used with IAP databases. The function is provided for simplicity, as its use is not dependent on a database type.

Parameters

const TDesC& aSetting

Setting to get.

TUint32& aValue

On return, setting value.


GetCurrentDialInSettingL()

void GetCurrentDialInSettingL(const TDesC& aSetting, TUint32& aValue);

Support

Supported from 7.0

Description

Retrieve settings for the dial in IAP.

Parameters

const TDesC& aSetting

Setting to get.

TUint32& aValue

On return, setting value.

[Top]


Opening a view on the Connection Preferences table

Description

Views on the Connection Preferences table cannot be opened with the generic functions such as CCommsDatabaseBase::OpenViewLC(). Instead, one of the following must be used.

See also:


OpenConnectionPrefTableLC()

CCommsDbConnectionPrefTableView* OpenConnectionPrefTableLC();

Support

Supported from 6.1

Description

Opens a view on the Connection Preferences table.

When the use of the view object is complete, it should be popped from the cleanup stack, and deleted.

Return value

CCommsDbConnectionPrefTableView*

The opened view

Leave codes

KErrNoMemory, or DBMS-related errors


OpenConnectionPrefTableLC()

CCommsDbConnectionPrefTableView* OpenConnectionPrefTableLC(TCommDbConnectionDirection aDirection);

Support

Supported from 6.1

Description

Opens a view on the records in the Connection Preferences table with a specified direction.

When the use of the view object is complete, it should be popped from the cleanup stack, and deleted.

Parameters

TCommDbConnectionDirection aDirection

Direction of the records to include in the view

Return value

CCommsDbConnectionPrefTableView*

The opened view

Leave codes

KErrNoMemory, or DBMS-related errors


OpenConnectionPrefTableInRankOrderLC()

CCommsDbConnectionPrefTableView* OpenConnectionPrefTableInRankOrderLC(TCommDbConnectionDirection aDirection);

Support

Supported from 6.1

Description

Opens a view on the records in the Connection Preferences table with a specified direction, and with records sorted into ranking order.

Records are sorted in rank order from ranking 1 first. Records with rank 0 are not included.

When the use of the view object is complete, it should be popped from the cleanup stack, and deleted.

Parameters

TCommDbConnectionDirection aDirection

Direction of the records to include in the view

Return value

CCommsDbConnectionPrefTableView*

The opened view

Leave codes

KErrNoMemory, or DBMS-related errors


OpenConnectionPrefTableViewOnRankLC()

CCommsDbConnectionPrefTableView* OpenConnectionPrefTableViewOnRankLC(TCommDbConnectionDirection aDirection, TUint32 aRank);

Support

Supported from 6.1

Description

Opens a view on the records in the Connection Preferences table with a specified direction and ranking.

When the use of the view object is complete, it should be popped from the cleanup stack, and deleted.

Parameters

TCommDbConnectionDirection aDirection

Direction of the records to include in the view

TUint32 aRank

Ranking of the records to include in the view

Return value

CCommsDbConnectionPrefTableView*

The opened view

Leave codes

KErrNoMemory, or DBMS-related errors; KErrOverflow if the value of aRank exceeds the maximum allowed.

[Top]


Opening views by matching service type


OpenIAPTableViewMatchingBearerSetLC()

CCommsDbTableView* OpenIAPTableViewMatchingBearerSetLC(TUint32 aBearerSet, TCommDbConnectionDirection aDirection);

Support

Supported from 6.1

Description

Opens a view on records in the IAP table with a specified range of service types.

IAP records are included that have matching bearers and direction, as read from the Connection preference table, to those specified.

When the use of the view object is complete, it should be popped from the cleanup stack, and deleted.

Parameters

TUint32 aBearerSet

Bearers to match. For suitable values, see CONNECT_PREF_BEARER_SET in the Connection preferences table. Bitwise mask of the TCommDbBearer.

TCommDbConnectionDirection aDirection

Direction to match.

Return value

CCommsDbTableView*

The opened view.

Leave codes

KErrArgument

Either aBearerSet or aDirection is invalid.

Other

DBMS-related error codes.

See also:


OpenViewOnProxyRecordLC()

CCommsDbTableView* OpenViewOnProxyRecordLC(TUint32 aServiceId, const TDesC& aServiceType);

Support

Supported from 6.1

Description

Opens a view on records in the Proxies table with a specified range of service types and service IDs.

Proxies records are included that have matching service types and IDs. When the use of the view object is complete, it should be popped from the cleanup stack, and deleted.

Parameters

TUint32 aServiceId

ID of the service to match

const TDesC& aServiceType

Service type to match

Return value

CCommsDbTableView*

The opened view

Leave codes

KErrArgument

Either aServiceId or aServiceType is invalid.

Other

DBMS-related error codes.

See also:

[Top]


Access to the agent settings


SetAgentL()

void SetAgentL(const TDesC& aService, const TDesC& aAgent);

Support

Supported from 7.0

Description

Set the agent to be used when accessing the specified service.

Parameters

const TDesC& aService

The service that will use the agent. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE or CDMA2000 PACKET SERVICE TABLE.

const TDesC& aAgent

The agent to use.


SetAgentExtL()

void SetAgentExtL(const TDesC& aService, const TDesC& aAgentExt);

Support

Supported from 7.0

Description

Set the agent extension to be used when accessing the specified service.

Parameters

const TDesC& aService

The service that will use the agent extention. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE or CDMA2000 PACKET SERVICE TABLE.

const TDesC& aAgentExt

The agent extention to use.


SetAgentClientTimeoutL()

void SetAgentClientTimeoutL(const TDesC& aService, TInt aClientTimeout);

Description

Set the client timeout associated with the specified service.

Parameters

const TDesC& aService

The service that the client timeout is associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE or CDMA2000 PACKET SERVICE TABLE.

TInt aClientTimeout

The client timeout.


SetAgentRouteTimeoutL()

void SetAgentRouteTimeoutL(const TDesC& aService, TInt aRouteTimeout);

Description

Set the route timeout associated with the specified service.

Parameters

const TDesC& aService

The service that the client route timeout is associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE or CDMA2000 PACKET SERVICE TABLE.

TInt aRouteTimeout

The route timeout.


GetAgentL()

void GetAgentL(const TDesC& aService, TDes& aAgent);

Description

Gets the agent associated with the specified service.

Parameters

const TDesC& aService

The service that the agent associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE or CDMA2000 PACKET SERVICE TABLE.

TDes& aAgent

On return, the agent.


GetAgentExtL()

void GetAgentExtL(const TDesC& aService, TDes& aAgentExt);

Description

Gets the agent extension associated with the specified service.

Parameters

const TDesC& aService

The service that the agent associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE or CDMA2000 PACKET SERVICE TABLE.

TDes& aAgentExt

On return, the agent extention.


GetAgentClientTimeoutL()

TInt GetAgentClientTimeoutL(const TDesC& aService);

Description

Gets the client timeout associated with the specified service.

Parameters

const TDesC& aService

The service that the timeout is associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE or CDMA2000 PACKET SERVICE TABLE.

Return value

TInt

The agent timeout setting


GetAgentRouteTimeoutL()

TInt GetAgentRouteTimeoutL(const TDesC& aService);

Description

Gets the route timeout associated with the specified service.

Parameters

const TDesC& aService

The service that the route timeout is associated with. This is one of DIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE or CDMA2000 PACKET SERVICE TABLE.

Return value

TInt

The route timeout.


ClearAgentAndExtL()

void ClearAgentAndExtL(const TDesC& aService);

Description

Clear any agent, agent extension or timeout associated with the specified service.

Parameters

const TDesC& aService

The service that will be cleared of all the agent settings. This is one ofDIAL OUT ISP TABLE, DIAL IN ISP TABLE, OUTGOING WCDMA TABLE or CDMA2000 PACKET SERVICE TABLE.

[Top]


Notification service


RequestNotification()

TInt RequestNotification(TRequestStatus& aStatus);

Support

Withdrawn in 6.0

Description

Requests notification when any change is made to the database, whether by this client or any other.

The request is an asynchronous request.

When any change is made to the database, the outstanding notification request completes and TRequestStatus contains a value indicating what type of change has occurred. The value is one of the enumerators of the RDbNotifier::TEvent enumeration defined in d32dbms.h.

Alternatively, if an outstanding notification request is cancelled by a call to this CCommsDatabase's CancelRequestNotification() member function, then the request completes with a KErrCancel.

An outstanding notification request is also cancelled if the connection to the DBMS is severed through a call to Close().

Parameters

TRequestStatus& aStatus

A reference to the request status object. If the request is cancelled, this is set to KErrCancel. If the request completes normally, this is set to one of the enumerators of the RDbNotifier::TEvent enumeration.

Return value

TInt

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


CancelRequestNotification()

void CancelRequestNotification();

Support

Withdrawn in 6.0

Description

Cancels an outstanding request for notification of changes to the communications database.

An outstanding request completes with KErrCancel.

[Top]


Database type


Type()

TCommDbDatabaseType Type() const;

Support

Supported from 6.0
Withdrawn in 7.0

Description

Gets the database type.

Return value

TCommDbDatabaseType

The database type.

[Top]


Open the database


Open()

TInt Open();

Support

Withdrawn in 6.0

Description

Connects to the DBMS.

If the communications database does not exist, it is created with an empty set of tables before the connection to the server takes place.

The database is opened for shared access.

This function can be called any number of times on this CCommsDatabase object; however, creation of the communications database and connection to the DBMS server only occur on the first call to Open().

Return value

TInt

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


Close()

void Close();

Support

Withdrawn in 6.0

Description

Compacts, closes, and disconnects from, the communications database.

If there has been more than one earlier call to Open() on this CCommsDatabase object and this call is not the last call to Close(), then the database remains open, it is not compacted and the connection to the DBMS remains active.

If this is the last call to Close() on this CCommsDatabase object, then any outstanding notification request is cancelled.

Close() can be safely called, if the database has already been closed and the connection to the DBMS removed.


CloseDatabase()

void CloseDatabase();

Support

Withdrawn in 6.0

Description

Compacts and closes the communications database.

If there has been more than one earlier call to Open() on this CCommsDatabase object and this call is not the last call to CloseDatabase(), then the database remains open and is not compacted.

CloseDatabase() can be safely called, if the database has already been closed.

Notes:

This function does not disconnect the client from the DBMS. The connection can be severed later by calling Close().

If there is an outstanding request for notification of changes to the database, then this request remains outstanding while the connection to the DBMS remains.

[Top]


Open views onto a table in the communications database


OpenTableLC()

CCommsDbTableView* OpenTableLC(const TDesC& aTableName);

Support

Withdrawn in 6.0

Description

Opens a view onto a whole table and returns a pointer to that view.

The view excludes hidden records, unless access to them has previously been explicitly requested by calling the ShowHiddenRecords() member function of this object.

If the open process is succesful, the function constructs and returns a pointer to a CCommsDbTableView object which encapsulates the information on that view. The pointer is also put onto the cleanup stack.

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

Return value

CCommsDbTableView*

A pointer to the view object.

Leave codes

The function may leave for a number of reasons, for example, if the table named in aTablename does not exist.

Notes:


OpenViewMatchingUintLC()

CCommsDbTableView* OpenViewMatchingUintLC(const TDesC& aTableName, const TDesC& aColumnToMatch, TUint32 aValueToMatch);

Support

Withdrawn in 6.0

Description

Opens a view onto a specified table based on a matching unsigned integer value, and returns a pointer to that view.

The view includes all those records where the column, identified by aColumnToMatch, matches the unsigned integer value aValueToMatch.

The view excludes hidden records, unless access to them has previously been explicitly requested by calling the ShowHiddenRecords() member function of this object.

If the open process is succesful, the function constructs and returns a pointer to a CCommsDbTableView object which encapsulates the information on that view. The pointer is also put onto the cleanup stack.

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumnToMatch

A reference to a descriptor containing the name of the column to be used in the selection process.

TUint32 aValueToMatch

The value to be matched with the content of column aColumnToMatch.

Return value

CCommsDbTableView*

A pointer to the view object.

Leave codes

The function may leave for a number of reasons, for example, if the table does not exist or the named column cannot be found.

Notes:


OpenViewMatchingBoolLC()

CCommsDbTableView* OpenViewMatchingBoolLC(const TDesC& aTableName, const TDesC& aColumnToMatch, TBool aValueToMatch);

Support

Withdrawn in 6.0

Description

Opens a view onto a specified table based on a matching boolean value, and returns a pointer to that view.

The view includes all those records where the column, identified by aColumnToMatch, matches the boolean value aValueToMatch.

The view excludes hidden records, unless access to them has previously been explicitly requested by calling the ShowHiddenRecords() member function.

If the open process is succesful, the function constructs and returns a pointer to a CCommsDbTableView object which encapsulates the information on that view. The pointer is also put onto the cleanup stack.

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumnToMatch

A reference to a descriptor containing the name of the column to be used in the selection process.

TBool aValueToMatch

The value to be matched with the content of column aColumnToMatch.

Return value

CCommsDbTableView*

A pointer to the view object.

Leave codes

The function may leave for a number of reasons, for example, if the table does not exist or the named column cannot be found.

Notes:


OpenViewMatchingTextLC()

CCommsDbTableView* OpenViewMatchingTextLC(const TDesC& aTableName, const TDesC& aColumnToMatch, const TDesC8& aValueToMatch);

Support

Withdrawn in 6.0

Description

Opens a view onto a specified table based on a matching 8 bit text type, and returns a pointer to that view.

The view includes all those records where the column, identified by aColumnToMatch, matches the narrow text supplied in the descriptor aValueToMatch.

The view excludes hidden records, unless access to them has previously been explicitly requested by calling the ShowHiddenRecords() member function of this object.

If the open process is succesful, the function constructs and returns a pointer to a CCommsDbTableView object which encapsulates the information on that view. The pointer is also put onto the cleanup stack.

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumnToMatch

A reference to a descriptor containing the name of the column to be used in the selection process.

const TDesC8& aValueToMatch

The narrow (ASCII) text to be matched with the content of column aColumnToMatch.

Return value

CCommsDbTableView*

A pointer to the view object.

Leave codes

The function may leave for a number of reasons, for example, if the table does not exist or the named column cannot be found.

Notes:


OpenViewMatchingTextLC()

CCommsDbTableView* OpenViewMatchingTextLC(const TDesC& aTableName, const TDesC& aColumnToMatch, const TDesC16& aValueToMatch);

Support

Withdrawn in 6.0

Description

Opens a view onto a specified table based on a matching 16 bit text type, and returns a pointer to that view.

The view includes all those records where the column, identified by aColumnToMatch, matches the wide text supplied in the descriptor aValueToMatch.

The view excludes hidden records, unless access to them has previously been explicitly requested by calling the ShowHiddenRecords() member function of this object.

If the open process is succesful, the function constructs and returns a pointer to a CCommsDbTableView object which encapsulates the information on that view. The pointer is also put onto the cleanup stack.

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumnToMatch

A reference to a descriptor containing the name of the column to be used in the selection process.

const TDesC16& aValueToMatch

The wide (Unicode) text to be matched with the content of column aColumnToMatch.

Return value

CCommsDbTableView*

A pointer to the view object.

Leave codes

The function may leave for a number of reasons, for example, if the table does not exist or the named column cannot be found.

Notes:


OpenViewLC()

CCommsDbTableView* OpenViewLC(const TDesC& aTableName, const TDesC& aSqlQuery);

Support

Withdrawn in 6.0

Description

Opens a view onto a specified table based on an explicitly coded SQL query, and returns a pointer to that view.

The view includes all those records which match the SQL query supplied in the descriptor aSqlQuery. It is the caller's responsibility to code this query correctly.

As the SQL query is defined by the caller, the resulting view does not exclude hidden records unless explicitly stated in the query itself. To exclude hidden records, insert Hidden=0 as a search condition into the SQL query text.

If the open process is succesful, the function constructs and returns a pointer to a CCommsDbTableView object which encapsulates the information on that view. The pointer is also put onto the cleanup stack.

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aSqlQuery

A reference to a descriptor containing the SQL query text

Return value

CCommsDbTableView*

A pointer to the view object.

Leave codes

The function may leave for a number of reasons, for example, if the table does not exist or the named column cannot be found.

[Top]


Default record handling


GetDefaultRecordL()

void GetDefaultRecordL(const TDesC& aTableName, TUint32& aId);

Support

Withdrawn in 6.0

Description

Gets the Id of the default record belonging to a specified table. The Id is copied into aId.

The only tables which can have a default record are:

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

TUint32& aId

A reference to an unsigned integer passed by the caller. On successful return from this function, contains the Id of the default record.

Leave codes

The function leaves with KErrNotSupported if it is called for any other table than those specified above.

Notes:


SetDefaultRecordL()

void SetDefaultRecordL(const TDesC& aTableName, TUint32 aId);

Support

Withdrawn in 6.0

Description

Identifies, to CommDb, the Id of the default record belonging to a specified table.

Parameters

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

TUint32 aId

The Id of the record in table aTableName which is to be the default record of this table.

Leave codes

The function leaves with KErrNotSupported if the table name passed in does not have a default record. E.g. Not all tables can have a default record; if the table name passed in aTableName is not one of: DIAL_OUT_SERVICE (the dial-out service table), CONNECTED_MODEM (the connected modem table), MODEM_PREFS (the modem preferences table), LOCATION, (the location table) then this function leaves with KErrNotSupported .

Notes:

[Top]


Transaction support


BeginTransaction()

TInt BeginTransaction();

Support

Withdrawn in 6.0

Description

Marks the start of a transaction and gets a shared read-lock on the database. Other clients of the database can concurrently acquire a shared read-lock but no client can gain an exclusive write-lock until this transaction (and any transaction started by other clients) completes as a result of a call to either CommitTransaction() or RollbackTransaction().

Return value

TInt

KErrNone if the database has been successfully locked; the transaction can start. KErrLocked if another client already has an exclusive write-lock on the database.

Notes:


CommitTransaction()

TInt CommitTransaction();

Support

Withdrawn in 6.0

Description

Marks the end of a transaction and commits any changes made since the start of the transaction. The client's shared read-lock is removed if no write operations were performed, or the exclusive write-lock is removed if write operations were performed.

Return value

TInt

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


RollbackTransaction()

void RollbackTransaction();

Support

Withdrawn in 6.0

Description

Marks the end of a transaction and abandons any changes made since the start of the transaction. The database is, in effect, rolled back to the state it was in at the beginning of the transaction. The client's shared read-lock is removed if no write operations were performed, or the exclusive write-lock is removed if write operations were performed.


InTransaction()

TBool InTransaction();

Support

Withdrawn in 6.0

Description

Tests whether a transaction is in progress, i.e. whether a call to BeginTransaction() has been called.

Return value

TBool

ETrue, if a transaction is in progress; EFalse, otherwise.

[Top]


Hidden records


ShowHiddenRecords()

TInt ShowHiddenRecords();

Support

Withdrawn in 6.0

Description

Ensures that hidden records are included in the search criteria when creating views using the member functions:

Return value

TInt

KErrNone always.

[Top]


Accessing timeouts


GetClientTimeoutL()

void GetClientTimeoutL(TUint32& aTimeout);

Support

Withdrawn in 6.0

Description

Gets the client timeout value from the communications database.

The function puts the value into aTimeout.

Parameters

TUint32& aTimeout

A reference to an unsigned integer passed by the caller. On successful return from this function, contains a copy of the client timeout value.


SetClientTimeoutL()

void SetClientTimeoutL(const TUint32 aTimeout);

Support

Withdrawn in 6.0

Description

Sets the value of the client timeout in the communications database.

Parameters

TUint32 aTimeout

The client timeout value to be set.


GetRouteTimeoutL()

void GetRouteTimeoutL(TUint32& aTimeout);

Support

Withdrawn in 6.0

Description

Gets the route timeout value from the communications database.

The function puts the value into aTimeout.

Parameters

TUint32& aTimeout

A reference to an unsigned integer passed by the caller. On successful return from this function, contains a copy of the route timeout value.


SetRouteTimeoutL()

void SetRouteTimeoutL(const TUint32 aTimeout);

Support

Withdrawn in 6.0

Description

Sets the value of the route timeout value in the communications dat