Text Field as Primary Key - but > 255 characters

  • Thread starter Thread starter AndyK
  • Start date Start date
A

AndyK

hi

Anyone got any idea how I can use a text field which can be greater than
255 characters (actually EntryID which uniquely identifies Outlook items)
and use it as the indexed primary key of an Access table? There is no
apparent way to index a memo field, and text fields only support up to 255
characters...

Thanks for any help.

andy
 
Or he could have another table which stores the >255 character values in a
memo field, with an autonumber primary key for use in other tables.

TC
 
You could break it into pieces, put the pieces into separate fields, and
then use all those fields as a composite primary key.

Or you could put a separate primary key on the table and then set the No
duplicates property on the EntryID field.
 
People

Thanks for responding!

As I need to be able to quickly pull back the record using a given
EntryID, whichever field in the table contains the EntryID will need to
be indexed. I will try the composite primary key idea.

Thanks again for taking the time.

rgrds

andy
 
Andy

These are just hypothetical musings, so they may not bear on your issues...

I understood that long, text-based primary keys are slower than shorter,
integer-type keys when it comes to matching, etc.

And if you are using the primary key to select a row, does that mean you'd
have to enter the more than 255 characters? What if you make a mistake
during data entry?

If you are using other fields to help you identify the correct row, and not
actually entering or selecting the 255+ character field you are proposing as
a primary key, then no one actually has to see it (and tell the difference
in the 247th character), or enter it.

If true, you could use a simple Autonumber field (also not seen nor entered
manually), and preserve your 255+ character fields (also not seen/entered).

JOPO (just one person's opinion)

Jeff Boyce
<Access MVP>
 
Back
Top