×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    63

    DBMS Panic Table 9 (EDbStreamOpen)

    Hello,
    I am refering the sample DBMS example which i got from the forum .I want to add one more column to the database for books in which i will be storing long text . For that i will have to use an object of RDbColWriteStream . Now this my code for adding data in the columns



    TInt CBookDb::AddBookWithCppApi(const TDesC& aAuthor,
    const TDesC& aTitle,
    const TDesC& aDescription,const TDesC& aMoreDescription)
    {

    if(aAuthor.Length()==0 || aDescription.Length()==0 || aMoreDescription.Length()==0)
    {
    return KErrGeneral;
    }

    // Create an updateable database table object
    RDbTable table;
    TInt err = table.Open(iBookDb, KBooksTable, table.EUpdatable);

    if(err!=KErrNone)
    {
    return err;
    }

    CDbColSet* booksColSet = table.ColSetL();
    CleanupStack::PushL(booksColSet);

    table.Reset();
    RDbColWriteStream writeStream;
    //RDbColWriteStream writeStream1;

    TRAPD(error,
    table.InsertL();
    table.SetColL(booksColSet->ColNo(KBooksAuthorCol), aAuthor); // col = 1
    table.SetColL(booksColSet->ColNo(KBooksTitleCol), aTitle); // col = 2
    // Use a stream for the long text column
    writeStream.OpenL(table, booksColSet->ColNo(KBooksDescriptionCol));
    writeStream.WriteL(aDescription);
    writeStream.OpenL(table, booksColSet->ColNo(KBooksDateCol));
    writeStream.WriteL(aMoreDescription);
    );

    if(error!=KErrNone)
    {
    return error;
    }
    writeStream.Close();
    //writeStream1.Close();

    TRAP(err, table.PutL()); // Complete changes (the insertion)
    if(err!=KErrNone)
    {
    return err;
    }

    CleanupStack::PopAndDestroy(booksColSet);
    table.Close();

    return KErrNone;

    }





    this is how i have created the table (its the same code from the example)


    void CBookDb::CreateBooksTableL()
    {

    // Specify columns for Books table
    TDbCol authorCol(KBooksAuthorCol, EDbColText); // Using default length
    TDbCol titleCol(KBooksTitleCol, EDbColText, KTitleMaxLength);
    titleCol.iAttributes = TDbCol::ENotNull;
    TDbCol descriptionCol(KBooksDescriptionCol, EDbColLongText); // Stream Data
    TDbCol moredescriptionCol(KBooksDateCol, EDbColLongText); // Stream Data

    // Add the columns to column set
    CDbColSet* bookColSet = CDbColSet::NewLC();
    bookColSet->AddL(authorCol);
    bookColSet->AddL(titleCol);
    bookColSet->AddL(descriptionCol);
    bookColSet->AddL(moredescriptionCol);


    // Create the Books table
    User::LeaveIfError(iBookDb.CreateTable(KBooksTable,
    *bookColSet));
    CleanupStack::PopAndDestroy(bookColSet);
    }




    rest of the code is same as that in the sample example , but when i am adding the data it is giving me DBMS Table 9 Panic at the line i have underlined in the function AddBookWithCppApi . the panic is EDbStreamOpen
    now is this just because i am using the same write stream object to open two columns or it has nothing to do with that .

    Exactly when does this EDbStreamOpen panic occurs does any one knows

    Thanks in advance


    symbians60

  2. #2
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122

    Re: DBMS Panic Table 9 (EDbStreamOpen)

    On a quick glance, you are calling OpenL() on the same stream object twice without closing it in between. The panic is raised when trying to open an already open stream.

    Lauri

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    63

    Re: DBMS Panic Table 9 (EDbStreamOpen)

    Thanks Laa laa , thank you very much . What a silly mistake it was on my part .But actually exact reason behind all these panics is not available any where , i am not able to find it , i got the list of the panics from the Newlc but i haven't found the reason as to when a particular panic given the list is raised by the system.If you have any such document i will be thankful to you if you let me know about that .


    Thanks
    symbians60

Similar Threads

  1. Replies: 5
    Last Post: 2010-12-06, 11:26
  2. Using Bluetooth serial port in MIDlets (nokia 9500 issue)
    By orsteglasy in forum Mobile Java Networking & Messaging & Security
    Replies: 11
    Last Post: 2007-10-07, 21:49
  3. DBMS panic 2
    By xiaowato in forum Symbian
    Replies: 2
    Last Post: 2006-09-08, 04:17
  4. Replies: 0
    Last Post: 2005-07-04, 11:08
  5. DBMS Insert panic error
    By zerglim in forum Symbian
    Replies: 3
    Last Post: 2004-07-23, 05:38

Posting Permissions

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