×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    26

    Question how to set record index value to initial or zero ?

    I am deleting records from RMS for first time it is deleting fine. But when I am deleting record for second time the function is throwing an exception
    Code:
    javax.microedition.rms.InvalidRecordIDException
    That is why I want to reinitialize record ID index to zero to avoid this exception.

    I will be thankfull if anyone will explain me with code or example.

    Thanks in advance.

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: how to set record index value to initial or zero ?

    Hmmmm.... why on earth do you want to delete same record twice? One time is enough. Then it is is gone and if you try to delete that non-existing record another time, of course the system alerts you...
    Do you have a good reason to delete it twice (or more times)?

    Of course you could always place the record deletion inside a try-block and handle the exception there. However be careful with that approach, as then you might end up in a situation when that exception is thrown for a good reason and your app should behave differently instead of just not reacting to it...

    Hartti

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    26

    Re: how to set record index value to initial or zero ?

    Hi Hartti,

    Actually I don't want to delete same record again and again. I have to delete the different records. But for first time it is working fine and all the records are deleted. but when i press delete button again the the exception is caught the reason is due to the record id is not initialized as the records deleted before were starting from index id - 1. but after deletion the index id is not initialized. can you help me with some code or example ?

    In one post i read that all records should taken in a vector and deleted. then the records will be inserted in RMS from Index id-1.

    this is the post kindly make it easy for me http://www.developer.nokia.com/Commu...ecord-deletion

  4. #4
    Regular Contributor
    Join Date
    Dec 2011
    Posts
    174

    Re: how to set record index value to initial or zero ?

    Hi maaz4,

    The exception is thrown because you are trying to delete a record that doesn’t exist.

    Here’s a link for sorting records in RMS that might help you to solve your problem.

    http://www.developer.nokia.com/Commu...sorting_in_RMS

    Regards,
    tiviinik

  5. #5
    Registered User
    Join Date
    Jun 2011
    Posts
    26

    Re: how to set record index value to initial or zero ?

    thank tiviinik

Similar Threads

  1. Appending another byte array to the same record in a record store
    By cryptyritu in forum Mobile Java General
    Replies: 2
    Last Post: 2011-01-13, 07:48
  2. Initial Configuration
    By sourabh0612 in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2010-05-29, 21:21
  3. Index on Record
    By solaleh in forum Mobile Java General
    Replies: 7
    Last Post: 2009-09-30, 07:44
  4. Replies: 3
    Last Post: 2008-04-23, 18:24
  5. APP with no initial UI.
    By kdallan in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-09-28, 05:25

Posting Permissions

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