Hi,
I want to increment the Index of database to be incremented automatically...So i am using following code while creating the database.
TDbCol CustomerID(KcustomerIDCol, EDbColInt8);
CustomerID.iAttributes = TDbCol::EAutoIncrement;
But while inserting the data into database,it is crashing here:
TQueryBuffer QueryBuffer;
_LIT(KSelect,"SELECT * FROM ");
//TQueryBuffer QueryBuffer;
QueryBuffer.Copy(KSelect);
QueryBuffer.Append(KSim_Registrationtable);
iDatabase.Begin();
RDbView MyView;
User::LeaveIfError(MyView.Prepare(iDatabase, TDbQuery(QueryBuffer,
EDbCompareNormal)));
User::LeaveIfError(MyView.EvaluateAll());
CleanupClosePushL(MyView);
MyView.InsertL();
MyView.SetColL(1, aSim_Registration1.iCustomerID); // it crashes here,
MyView.SetColL(2, aSim_Registration1.iFirstName);
MyView.SetColL(3, aSim_Registration1.iLastName);
Can u tel me what is my mistake?y it is crashing? and if i wont increment any thing and if i insert twice,then it is overwritting the 1st data.... Please help me yar... please

Reply With Quote


