I found the problem. I didn't get the corresponding table.
I should use "CCommsDbTableView* OpenViewMatchingTextLC(const TDesC& aTableName, const TDesC& aColumnToMatch, const TDesC8& aValueToMatch);" to get correct table.
Code:
CCommsDbTableView* lanServiceView;
TRAP(err, lanServiceView = commDb->OpenViewMatchingTextLC( TPtrC( LAN_SERVICE ),
TPtrC( COMMDB_NAME ), _L8("ApE51"));
CleanupStack::Pop(1);
);
CleanupStack::PushL(lanServiceView);
err = commDb->BeginTransaction();
lanServiceView->UpdateRecord();
lanServiceView->WriteBoolL(TPtrC(SERVICE_IP_ADDR_FROM_SERVER), EFalse);
lanServiceView->WriteBoolL(TPtrC(SERVICE_IP_DNS_ADDR_FROM_SERVER), EFalse);
lanServiceView->WriteTextL(TPtrC(SERVICE_IP_GATEWAY), _L("169.254.1.1"));
lanServiceView->WriteTextL(TPtrC(SERVICE_IP_NETMASK), _L("169.254.255.255"));
lanServiceView->PutRecordChanges();
err = commDb->CommitTransaction();