Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to get Record ID in RMS  RSS feed

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In RMS is there any way to retrieve particular Record's record ID in a RecordStore.

for example::
I have created a RecordStore which will hold Names.After entering names into RecordStore if i want to modify a particular record i need RecordId allocated for that perticular Record...As we know that it is unpedictable to guess RecordID because it may not take 0,1,2,.....so on consecutive numbers as RecordID
 
Ranch Hand
Posts: 1902
Hibernate Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose it really depends on how you're doing it.

You could always get a RecordEnumerator with an appropriate RecordFilter and RecordComparator to look through the RMS to find the one you're looking for. Or, if it won't be too ungainly, you can do what I did with one app, and keep a lookup table of the record IDs in your application (I did this due to the possibility of frequent updates of information, to spare myself having to write searches as I was doing it quick-and-dirty).

But no, you're correct that you can't assume that it's consecutive.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!