×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    371

    Thumbs up Auto incrementing problem while creating the database

    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

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,673

    Re: Auto incrementing problem while creating the database

    Crashing... That is bad indeed.

  3. #3
    Registered User
    Join Date
    Feb 2007
    Location
    India
    Posts
    1,128

    Re: Auto incrementing problem while creating the database

    Hi Prathi,

    It will auto incremented....Not required to add...........

    MyView.PutL();......and commit database...For more info Go through database example

  4. #4
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    371

    Re: Auto incrementing problem while creating the database

    what may be the reason for crashing?where i had gone wrong???Please help me in finding that.............

  5. #5
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    371

    Re: Auto incrementing problem while creating the database

    Quote Originally Posted by kis_spn View Post
    Hi Prathi,

    It will auto incremented....Not required to add...........

    MyView.PutL();......and commit database...For more info Go through database example
    I had seen that example... Same i had done,they have used MyView.PutL(); and commit() also..... But my app is crashing here only::
    MyView.SetColL(1, aSim_Registration1.iCustomerID);

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,673

    Re: Auto incrementing problem while creating the database

    Quote Originally Posted by prathi View Post
    what may be the reason for crashing?where i had gone wrong???Please help me in finding that.............
    http://wiki.forum.nokia.com/index.ph...ded_panic_code
    http://wiki.forum.nokia.com/index.php/Error_codes
    You know, the usual stuff.

  7. #7
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    371

    Re: Auto incrementing problem while creating the database

    I had gone throught the link and tried to get the ErrRd file in emulator but i dint get...can u please tel me how to get an panic errors in emulator?i.e., installing the ErrRd file in emulator...Please tel me..
    Last edited by prathi; 2011-02-16 at 10:58.

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,673

    Re: Auto incrementing problem while creating the database

    Start the emulator somehow (via the program group of the SDK for example). It has a menubar on the top (File, Tools, Help). You need Tools/Preferences.
    If it produces an error message about ECMT Manager, apply this fix: http://wiki.forum.nokia.com/index.ph...ge_in_emulator

  9. #9
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    371

    Re: Auto incrementing problem while creating the database

    Hi,
    It is not producing any error message about ECMT manager... I went for tools -> preferences ->Extended panic code file".. Then too i am not errRd file in d/resources .... Please can u tel me what else i need to do after selecting Extended panic code file....

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,673

    Re: Auto incrementing problem while creating the database

    The errrd file is actually created in epoc32\winscw\c\resource, but you have nothing to do with it. It is just a marker, after that the emulator will display its error messages, as the screenshot shows in the article.
    Also note that there is a logfile, http://wiki.forum.nokia.com/index.php/Epocwind.out, it will contain the panic message even when the emulator exits.

  11. #11
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    371

    Thumbs up Re: Auto incrementing problem while creating the database

    but still emulator is not displaying the errors........ Why it is not displaying even after i had enabled "Extended panic code file" in C++ Debug tab. Please help me out in displaying the error messages in emulator.... y its not displaying error message even after i enabled "Extended panic code file"
    Last edited by prathi; 2011-02-17 at 09:58.

Similar Threads

  1. problem creating the database in the private path
    By keerthi.ck06 in forum Symbian
    Replies: 2
    Last Post: 2009-09-24, 13:47
  2. Panic KERN-EXEC 3 while opening/creating database
    By sanjayrajwani in forum Symbian
    Replies: 4
    Last Post: 2008-07-18, 17:38
  3. problem in creating database
    By rahulchavan_2000 in forum Symbian
    Replies: 1
    Last Post: 2005-02-22, 06:44
  4. Replies: 2
    Last Post: 2004-08-25, 04:50
  5. problem while creating database
    By ManishPatil in forum Symbian
    Replies: 4
    Last Post: 2003-12-26, 15:33

Posting Permissions

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