×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    2

    CCommsDbTableView Help

    Hi,
    I got a problem in accessing the database, all i need is to retrive the element form existing table, problem with How to use CCommsDbTableView? any one help me in that?

  2. #2
    Regular Contributor
    Join Date
    Mar 2004
    Location
    Novi Sad - Serbia
    Posts
    63

    Using the CCommsDbTableView

    Hi phani_gudi,

    Here is a picce of code I use to read a data from the MODEM table:

    Code:
    	CCommsDatabase* db = CCommsDatabase::NewL(EDatabaseTypeUnspecified);
    	CleanupStack::PushL(db);
    	
    	// Connect to the Modem table.
    	logln("Before CCommsDbTableView* table = db->OpenTableLC(TPtrC(MODEM))");
    	CCommsDbTableView* table = db->OpenTableLC(TPtrC(MODEM));
    
    	TInt tabErr = table->GotoFirstRecord();
    	User::LeaveIfError(tabErr);
    	
    	TUint32 id;
    	table->ReadUintL(TPtrC(COMMDB_ID), id);
    	
    	if (id == (TUint32)KDbNullColNo){ // this was the template record, so go to the next one
    		User::LeaveIfError(table->GotoNextRecord());
    		table->ReadUintL(TPtrC(COMMDB_ID),id);
    	}
    	
    	table->ReadTextL(TPtrC(MODEM_TSY_NAME), aValue);
    	
    	CleanupStack::PopAndDestroy(2); // table and db
    Here, I read one TUint32 value (COMMDB_ID) and one TDes8 value (MODEM_TSY_NAME).

    You can find all tables and columns names in the doc or in the Epoc32\include\cdbcols.h file.

    I hope this can help you.

    Cheers,
    Sasa

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×