you have not set: iPref.SetDirection(ECommDbConnectionDirectionOutgoing); iPref.SetBearerSet(KCommDbBearerPSD );
I am not sure if they are mandatory.
CCommsDatabase* db = CCommsDatabase::NewL();
CApUtils* apUtils = CApUtils::NewLC(*db);
// Convert IAP id to CommsDb id
aIap = apUtils->IapIdFromWapIdL(aSelectedIap);
By the way the 1st coms database id need not be 1. (AFAIK)
Try 1st querying the id from user. Then save it to a file when you know the connection is ok.