×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    23

    Record store problem

    Hi..
    Can anybody plz help me...
    I have created an aplication..
    For that i want save data on the data store..
    I can see it on the emulator as well as on handset..
    Bt when i restart the application, i can not see my data..
    what will be the problem..
    where data has been saved on handset...
    How to get the path.. if anybody has any idea please tell me..
    Thank You..

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    30

    Re: Record store problem

    are you calling the RecordStore.closeRecordStore() after adding the records to the recordstore (by calling addRecord)?
    Sreekanth Bellur,
    Symbian C++ Developer,
    Ravensoft Ltd.,
    Manchester,
    United Kingdom

  3. #3
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: Record store problem

    u dont need path to open record store all u need is the name of the record store. open ur record store like this and ur data will be there of course if u have stored it correctly. hereis a sample

    RecordStore rs= RecordStore.openRecordStore("Your Record Store", true);
    RecordEnumeration enumRecs = rs.enumerateRecords(null, null, false);

    if(enumRecs.hasNextElement())
    {
    int recordStoreId = enumRecs.nextRecordId();
    try
    {
    byte[] data = rs.getRecord(recordStoreId);
    DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data));

    Name = dis.readUTF();
    Address = dis.readUTF();
    Gender = dis.readUTF();

    } //end of try

    catch(Exception e)
    {
    rs.closeRecordStore();
    }// end of catch
    }// end of if

    rs.closeRecordStore();
    }
    Regards
    Nouman

  4. #4
    Registered User
    Join Date
    May 2007
    Posts
    13

    Re: Record store problem

    Hi Harshal
    It would be easy to figure out if u could post in your code and also would like to to know the device you are talking about.

    Mean while u could check for--
    1>what happens if u relaunch the app on emulator even if its not visible there then somethings wrong with the code else if it is visible then its an device issue
    2>make sure before quitting your app that the recordstore was actually written
    3>check for exceptions thrown while writting to recordstore.
    4>As suggested above make sure u are closing the recordstore.

  5. #5
    Registered User
    Join Date
    Apr 2007
    Posts
    23

    Re: Record store problem

    Quote Originally Posted by sreekanthbellur
    are you calling the RecordStore.closeRecordStore() after adding the records to the recordstore (by calling addRecord)?
    Hi Shrikanth..
    i have created a record store ..
    It's working fine..
    it's adding records properly...
    Bt i am not able to delete the records...
    I hav called deleteRecord() bt not able to delete..
    what will be the problem?

  6. #6
    Registered User
    Join Date
    Apr 2007
    Posts
    23

    Re: Record store problem

    Quote Originally Posted by nicenouman
    u dont need path to open record store all u need is the name of the record store. open ur record store like this and ur data will be there of course if u have stored it correctly. hereis a sample

    RecordStore rs= RecordStore.openRecordStore("Your Record Store", true);
    RecordEnumeration enumRecs = rs.enumerateRecords(null, null, false);

    if(enumRecs.hasNextElement())
    {
    int recordStoreId = enumRecs.nextRecordId();
    try
    {
    byte[] data = rs.getRecord(recordStoreId);
    DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data));

    Name = dis.readUTF();
    Address = dis.readUTF();
    Gender = dis.readUTF();

    } //end of try

    catch(Exception e)
    {
    rs.closeRecordStore();
    }// end of catch
    }// end of if

    rs.closeRecordStore();
    }
    Hi nicenumen..

    i have created a record store ..

    It's working fine..

    it's adding records properly...

    Bt i am not able to delete the records...

    I hav called deleteRecord() bt not able to delete..

    what will be the problem?

  7. #7
    Registered User
    Join Date
    Apr 2007
    Posts
    23

    Re: Record store problem

    Quote Originally Posted by adilb
    Hi Harshal
    It would be easy to figure out if u could post in your code and also would like to to know the device you are talking about.

    Mean while u could check for--
    1>what happens if u relaunch the app on emulator even if its not visible there then somethings wrong with the code else if it is visible then its an device issue
    2>make sure before quitting your app that the recordstore was actually written
    3>check for exceptions thrown while writting to recordstore.
    4>As suggested above make sure u are closing the recordstore.

    Hi adilb...
    I have created a record store..
    and i could able to write and read the records from record store...
    bt noe the problem is i m not able to delete the record from record store..
    i have wriitten the deleteRecord(id) function..
    Here is my function..

    rs = RecordStore.openRecordStore("Inbox", true);

    if (rs.getNumRecords() == MAX)
    {
    re = rs.enumerateRecords(null, null, false);
    while (re.hasNextElement())
    {
    int id = re.nextRecordId();
    if (id == 0)
    {
    rs.deleteRecord(id);
    }
    }

    re.destroy();
    }
    rs.addRecord( array,0,array.length);
    rs.closeRecordStore();
    }
    what will be the problem??
    Thanks...

  8. #8
    Regular Contributor
    Join Date
    Mar 2004
    Location
    Mobile Village - IN
    Posts
    78

    Re: Record store problem

    DELETE FROM table-name [ WHERE search-condition ]

    =====

    You can do this using the DELETE command in the format DELETE Database$,Table$. This deletes the table, Table$, from the database, Database$. Note that to do this all of the views on the database, and hence the database itself, must be closed.
    ==

  9. #9
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: Record store problem

    rs = RecordStore.openRecordStore("Inbox", true);

    if (rs.getNumRecords() == MAX)
    {
    re = rs.enumerateRecords(null, null, false);
    while (re.hasNextElement())
    {
    int id = re.nextRecordId();
    if (id == 0) // change here
    {
    rs.deleteRecord(id);
    }
    }

    re.destroy();
    }
    rs.addRecord( array,0,array.length);
    rs.closeRecordStore();
    }


    you are deleting only one record having ID =0. infact that is the only record that will be deleted. after that u add another record this record will not have id 0. it will have a different ID.
    Regards
    Nouman

Similar Threads

  1. Problem MMC+USB Connection
    By Fede81 in forum Symbian
    Replies: 1
    Last Post: 2007-06-14, 06:13
  2. Record live video problem
    By gordon32 in forum Mobile Java General
    Replies: 1
    Last Post: 2007-03-14, 01:57
  3. saving objects on a record store
    By noobprogrammer in forum Mobile Java General
    Replies: 2
    Last Post: 2006-10-09, 07:05
  4. Record store support in Nokia 3650
    By chandrasarav in forum Mobile Java General
    Replies: 2
    Last Post: 2004-08-30, 11:57
  5. Video record problem in 7650?
    By ctchu1128 in forum Symbian
    Replies: 6
    Last Post: 2003-04-28, 17: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
  •