×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    46

    Query on reading Database Items

    HI Experts,

    I have created Database and few columns created as EDbColLongText.

    .................
    CDbColSet* columns=CDbColSet::NewLC();

    // Add Columns
    TDbCol id(NCol1, EDbColInt32);

    // automatic indexing for items,it is our key field.
    id.iAttributes=id.EAutoIncrement;
    columns->AddL(id);
    columns->AddL(TDbCol(NCol2, EDbColInt32));

    columns->AddL(TDbCol(NCol3, EDbColLongText));
    columns->AddL(TDbCol(NCol4, EDbColLongText));


    // Create a table
    TRAPD(err, aDatabase.CreateTable(KTableExample, *columns) );
    .................

    But while reading these items from database I get Panic in my application.
    In below code snippet,
    while reading colDes(3) value application crashes and i found that ColDes API will read the item type EDbColText and not EDbColLongText. SO, as a result application crashes.

    Do we have any solution to this or alernative API to get long descriptor column from database?

    RDbView Myview;
    Myview.Prepare(iDatabase, TDbQuery(aQueryBuffer));
    CleanupClosePushL(Myview);
    Myview.EvaluateAll();
    Myview.FirstL();
    while (Myview.AtRow())
    {
    Myview.GetL();
    ...
    id = Myview.ColInt(1);
    value = Myview.ColInt(2);
    ivalue2 = Myview.ColDes(3);
    ivalue3 = Myview.ColDes(4);
    Myview.NextL();
    }

  2. #2
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Query on reading Database Items


Similar Threads

  1. Replies: 28
    Last Post: 2011-04-20, 11:13
  2. Reading S60 Database file on PC??
    By Suyash in forum Symbian
    Replies: 13
    Last Post: 2008-10-27, 12:15
  3. Replies: 3
    Last Post: 2008-08-24, 14:58
  4. Multiline Query in 3rd edition sdk
    By parag_purkar in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-09-26, 03:54
  5. InsertL in database Controls the DB
    By Blkangel in forum Symbian
    Replies: 5
    Last Post: 2004-01-13, 15:02

Posting Permissions

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