• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accesing data from RecordStore

 
Alphanzox Alex
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers!
Have got query. Am facing problem accesing data within a RecordStore. Consider the following code:
RecordStore rs;
rs = RecordStore.openRecordStore("TISData",true);
rs.deleteRecord(index);
rs.closeRecordStore();
here total record available are =2, whereas the index variable also has the value 2. Upon execution the throws an InvalidRecordIDException, can you explain.
Also if a record is deleted from index =1 and another record is added will also be added to index = 1 ?
Regards,
ALex
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The id of deleted record is NOT resued -- it is in the spec. That might answer your first question as well since the second record in your RMS might not always have id==2.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic