Hi
I want to update the message which already in the database.
I am able to get the selected masage to the TextEditior, but when i give update it is updating in the 0th positon only not in the selected message index value. Please give me the solution and my code for update is
Idx = this->iTemplateContainer->GetValueL();
MsgId.AppendNum(Idx);
_LIT(KSelect,"SELECT * FROM Template");
_LIT(KWhere, " WHERE MsgId ");
_LIT(KEqual, " = '");
_LIT(KOrderBy, "'ORDER BY MsgId ");
delQuery.Copy(KSelect);
delQuery.Append(KWhere);
delQuery.Append(KEqual);
delQuery.Append(MsgId);
delQuery.Append(KOrderBy);
newText = this->iMessageContainer->GetText();
this->view1->Prepare((*(this->database)),TDbQuery(delQuery),RDbView::EUpdatable);
this->view->EvaluateAll();
//this->view->FirstL();
for (this->view->FirstL();this->view->AtRow();this->view->NextL())
{
if(this->view->AtRow())
{
this->view->GetL();
this->view->UpdateL();
msg.Copy(newText->Des());
this->view->SetColL(1,MsgId);
this->view->SetColL(2,msg);
this->view->PutL();
}
this->database->Commit();
REgards
Deepa

Reply With Quote



