diff -r 48780e181b38 -r 578be2adaf3e Symbian3/PDK/Source/GUID-F48CC072-66A0-5DBA-99A2-2F3BABF83BEB.dita --- a/Symbian3/PDK/Source/GUID-F48CC072-66A0-5DBA-99A2-2F3BABF83BEB.dita Tue Jul 20 12:00:49 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-F48CC072-66A0-5DBA-99A2-2F3BABF83BEB.dita Fri Aug 13 16:47:46 2010 +0100 @@ -1,80 +1,80 @@ - - - - - -Using -Template Records: TutorialThis tutorial shows you how to create a template record and how -to load a template record. - - -

Before you start, -you must understand:

    -
  • the general concept -of the Comms Database

  • -
  • the specific concepts -of fields, records, links and tables

  • -
  • how to write and build -application code to run on Symbian platform

  • -
-

A template record -contains default data values. You can use a template record when you create -a record to add to the Comms Database.

For example, the records in -the DialOutISP table -are large. Many of the fields in a DialOutISP record have -values that are the same in all DialOutISP records. A template -record can contain these common values. When you create a DialOutISP record, -set the value of those fields to be copied from the template record to NULL. -Set the other fields in your DialOutISP record to values -that are specific to that record.

These principles apply to all record -types.

The following steps create and load a template record for the Network table.

- -Make sure that you -have created a session. - -Set the attribute -mask for this session to hidden. - -Template records are marked as hidden. Set the session mask to hidden -to allow you to view the template records. -cmdbSession->SetAttributeMask(ECDHidden); - - -Create a template -record and store it in the database. -... -// Create a "Network" record, but give it the unique numeric Id KCDDefaultRecord. -// The CommsDat API interprets the record Id KCDDefaultRecord to mean the -// template record. -CCDNetworkRecord* ptrNetworkRecord = (CCDNetworkRecord*)CCDRecordBase::RecordFactoryL(KCDTIdNetworkRecord); -ptrNetworkRecord->SetRecordId(KCDDefaultRecord); - -// Template records must be hidden. -ptrNetworkRecord->SetAttributes(ECDHidden); - -// Store the template record in the database -ptrNetworkRecord->StoreL(*cmdbSession); -... - -Load the template -record from the Comms Database -... -// Create an empty "Network" record, and set the record Id to KCDDefaultRecord -// The CommsDat API interprets the record Id KCDDefaultRecord to mean the -// template record. -CCDNetworkRecord* ptrNetworkRecord = (CCDNetworkRecord*)CCDRecordBase::RecordFactoryL(KCDTIdNetworkRecord); -ptrNetworkRecord->SetRecordId(KCDDefaultRecord); -ptrNetworkRecord->LoadL(*cmdbSession); -... - - -
-Comms Database - concepts + + + + + +Using +Template Records: TutorialThis tutorial shows you how to create a template record and how +to load a template record. + + +

Before you start, +you must understand:

    +
  • the general concept +of the Comms Database

  • +
  • the specific concepts +of fields, records, links and tables

  • +
  • how to write and build +application code to run on Symbian platform

  • +
+

A template record +contains default data values. You can use a template record when you create +a record to add to the Comms Database.

For example, the records in +the DialOutISP table +are large. Many of the fields in a DialOutISP record have +values that are the same in all DialOutISP records. A template +record can contain these common values. When you create a DialOutISP record, +set the value of those fields to be copied from the template record to NULL. +Set the other fields in your DialOutISP record to values +that are specific to that record.

These principles apply to all record +types.

The following steps create and load a template record for the Network table.

+ +Make sure that you +have created a session. + +Set the attribute +mask for this session to hidden. + +Template records are marked as hidden. Set the session mask to hidden +to allow you to view the template records. +cmdbSession->SetAttributeMask(ECDHidden); + + +Create a template +record and store it in the database. +... +// Create a "Network" record, but give it the unique numeric Id KCDDefaultRecord. +// The CommsDat API interprets the record Id KCDDefaultRecord to mean the +// template record. +CCDNetworkRecord* ptrNetworkRecord = (CCDNetworkRecord*)CCDRecordBase::RecordFactoryL(KCDTIdNetworkRecord); +ptrNetworkRecord->SetRecordId(KCDDefaultRecord); + +// Template records must be hidden. +ptrNetworkRecord->SetAttributes(ECDHidden); + +// Store the template record in the database +ptrNetworkRecord->StoreL(*cmdbSession); +... + +Load the template +record from the Comms Database +... +// Create an empty "Network" record, and set the record Id to KCDDefaultRecord +// The CommsDat API interprets the record Id KCDDefaultRecord to mean the +// template record. +CCDNetworkRecord* ptrNetworkRecord = (CCDNetworkRecord*)CCDRecordBase::RecordFactoryL(KCDTIdNetworkRecord); +ptrNetworkRecord->SetRecordId(KCDDefaultRecord); +ptrNetworkRecord->LoadL(*cmdbSession); +... + + +
+Comms Database + concepts
\ No newline at end of file