In relational databases, tables almost always have a unique identifier for each row, known as the primary key. While there are occasional reasons to do otherwise, it's common practice to use an otherwise meaningless integer for this key. This unique identifier can be used for joining the table or for identifying a row when you perform an update.
When adding data to a database table, it is expected that you will provide a value for this key. So where do you get an integer value that you can rely on to be unique?
This recipe shows you how to use the ADOdb facility for creating unique integer sequences, and for getting values from the sequence.