Thanks for reading this, I´ve created a date base, which has five field, the sentences that I used to create it are:


_LIT( KTable, "prestamos");
//crea una columna donde posicionar los elmentos
CDbColSet* columns= CDbColSet::NewLC();

_LIT( KName, "nombre");
TDbCol name( KName, EDbColText,40 );
name.iAttributes = TDbCol::ENotNull;
columns->AddL( nombre );

_LIT( KTipo, "tipo" );
TDbCol tip( KTipo, EDbColUint32 );
tipo.iAttributes = TDbCol::ENotNull;
columns->AddL( tipo );

_LIT( KObjeto, "objeto" );
TDbCol objeto( KObjeto, EDbColText,40 );
objeto.iAttributes = TDbCol::ENotNull;
columns->AddL( objeto);

_LIT( KComent, "coment" );
TDbCol coment( KComent, EDbColText,80 );
coment.iAttributes = TDbCol::ENotNull;
columns->AddL( coment );

_LIT( KPersonalId, "personal_id" );
TDbCol personal_id( KPersonalId, EDbColUint32 );
personal_id.iAttributes = TDbCol::ENotNull;
columns->AddL( personal_id );

User::LeaveIfError ( database.CreateTable ( KTable, *columns ) );
CleanupStack::PopAndDestroy(); // columns

_LIT(KSQLCreateTable, "CREATE TABLE prestamos (nombre CHAR (40) NOT NULL, tipo UNSIGNED INTEGER NOT NULL, objeto CHAR (40) NOT NULL, coment CHAR (80) NOT NULL, personal_id UNSIGNED INTEGER NOT NULL)");

For inserting data, I´ve used the following code

_LIT( KSQLInsert, "SELECT nombre, tipo, objeto, coment, personal_id FROM prestamos");

RDbView view;
view.Prepare( database, TDbQuery(KSQLInsert), RDbView::EInsertOnly );
view.SetColL(1, iNombre );
view.SetColL(2, iTipo );
view.SetColL(3, iObjeto );
view.SetColL(4, iComent );
view.SetColL(5, iPersonal_id );

_LIT(KSQLInsert, "INSERT INTO prestamos (nombre, tipo, objeto, coment, personal_id) VALUES ('");

_LIT( KSQLQuote1, "'" );
_LIT( KSQLQuote2, "'," );
_LIT( KSQLend, ")" );
_LIT( KComma, "," );

TBuf<KMaxSQLLength> SQLStatement;
SQLStatement = KSQLInsert;
SQLStatement.Append( iNombre ); SQLStatement.Append( KSQLQuote2 );
SQLStatement.AppendNum( iTipo );
SQLStatement.Append( KComma );
SQLStatement.Append( KSQLQuote1 );
SQLStatement.Append( iBirthday );
SQLStatement.Append( KSQLQuote2 );
SQLStatement.Append( KSQLQuote1 );
SQLStatement.Append( iComent );
SQLStatement.Append( KSQLQuote2 );
SQLStatement.AppendNum( iPersonal_id );
SQLStatement.Append( KSQLend );

But this code doesn&acute;t work, when I execute this code the data aren&acute;t stored into the data base....I&acute;ve examined all the code and I don&acute;t know how to solve it....please, can you help me?? Thanks