×
Namespaces

Variants
Actions

How to create access point

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: huwell (29 Jun 2007)
Last edited: hamishwillee (03 Feb 2012)

If you want to create a new entry in the IAP table.

The code works fine.

#include commdb.h 
#include cdbcols.h
 
 
//Link Against : commdb.lib
 
void CYourApp::SetNewIAP(TDesC8& aIAPName)
{
TUint32 aIAPId=0;
TInt aGPRSId=0;
TInt aId=0;
TInt aError;
 
TCommDbOpeningMethod aMethod;
static CCommsDatabase* aComDB =
CCommsDatabase::NewL(EDatabaseTypeIAP, aMethod);
CleanupStack::PushL(aComDB );
 
CCommsDbTableView* aView ;
 
aView = aComDB ->OpenTableLC(TPtrC(IAP));
aError = aView->InsertRecord(iapId);
 
aView->WriteTextL(TPtrC(COMMDB_NAME), aIAPName);
aView->WriteTextL(TPtrC(IAP_SERVICE_TYPE), TPtrC(OUTGOING_GPRS));
aView->WriteUintL(TPtrC(IAP_SERVICE), aGPRSId);
aView->WriteUintL(TPtrC(IAP_NETWORK_WEIGHTING), 0);
aView->WriteUintL(TPtrC(IAP_NETWORK), aId);
aView->WriteUintL(TPtrC(IAP_BEARER), 0);
aView->WriteTextL(TPtrC(IAP_BEARER_TYPE), TPtrC(MODEM_BEARER));
aView->WriteUintL(TPtrC(IAP_LOCATION), 2);
 
aError = aView->PutRecordChanges(EFalse, EFalse);
 
CleanupStack::Pop(aComDB);
CleanupStack::Pop(aView);
delete aView;
delete aComDB;
}


Internal links

This page was last modified on 3 February 2012, at 05:17.
70 page views in the last 30 days.
×