Answered by:
Does Access have a GUID setting?

Question
-
Hi,
I have 2 tables and I want setup a relation but cannot find the GUID. I checked the web but cannot find much on this topic. (hard to believe)
Thanks,
J
Saturday, August 27, 2011 12:39 PM
Answers
-
Access itself does not add a GUID to records. You build a relationship between tables on fields that you create yourself.
Regards, Hans Vogelaar- Marked as answer by CsharpLerner Saturday, August 27, 2011 1:19 PM
Saturday, August 27, 2011 12:55 PM
All replies
-
Access itself does not add a GUID to records. You build a relationship between tables on fields that you create yourself.
Regards, Hans Vogelaar- Marked as answer by CsharpLerner Saturday, August 27, 2011 1:19 PM
Saturday, August 27, 2011 12:55 PM -
Access (Jet/ACE) does indeed have a GUID. You can define a field to have a Data Type of Autonumber, then set its Field Size property to Replication ID (which is what ACE/Jet call a GUID). With this set up, new records will get a db engine generated GUID.
If you want to store your own GUID (or create a Foreign Key field that references a GUID primary key), you create a field with a Data Type of Number, then a Field Size property of Replication ID.
Also, note that some have assumed the Field Size of Replication ID to have been dropped with the .ACCDB format, but that is definately not true. The Field Size property of Replication ID is not dependant upon the Replication feature that was depricated from the .ACCDB formated database files.
Brent Spaulding | Access MVP- Edited by datAdrenalineMVP Saturday, August 27, 2011 4:45 PM minor edits
- Proposed as answer by Dylan-Meeus Saturday, August 27, 2011 10:37 PM
Saturday, August 27, 2011 4:42 PM -
Hans,
>> Access itself does not add a GUID to records. <<
That is an inaccurate statement, please read my reply regarding Number/Replication ID and Autonumber/Replication ID.
Brent Spaulding | Access MVPSaturday, August 27, 2011 4:44 PM -
>> I have 2 tables and I want setup a relation but cannot find the GUID <<
One more note, if all you want to do is relate your records, you could use the Autonumber/Long Integer and Number/Long Integer to do so. That combo has a much stronger presence in ACE/Jet datafiles than using a GUID for relational purposes.
Brent Spaulding | Access MVPSaturday, August 27, 2011 9:17 PM -
Brent,
are there any case studies of using Replication ID? Does it make sense? Never faced it in my practice, just want to understand its practical application.
Andrey V Artemyev | Saint-Petersburg, Russia
Russian blog artemyev.biztoolbox.ru
English blog enblog.biztoolbox.ruSaturday, August 27, 2011 9:36 PM -
>>That is an inaccurate statement, please read my reply regarding Number/Replication ID and Autonumber/Replication ID.
Regards, Hans VogelaarSaturday, August 27, 2011 9:36 PM -
Hello Hans ...
>> I meant that Access doesn't add a GUID to records by default, but thanks for your helpful additions. <<
That is most definately a correct statement! ...
Brent Spaulding | Access MVPSunday, August 28, 2011 1:10 AM -
Andrey,
>> are there any case studies of using Replication ID? Does it make sense? Never faced it in my practice, just want to understand its practical application. <<
I have used it when I "rolled my own" replication. I supported a system that had two sites and every night site 2 would email site 1 their copy of the database. I used Autonumber/Replication ID as the PK in all the tables. By doing so each site could add records without concern of duplication. With out that concern over my head, synchronization was quite easy.
I am sure there are other applications of a GUID's use, but that is how I have used it.
Brent Spaulding | Access MVPSunday, August 28, 2011 1:33 AM -
Andrey Artemyev wrote:
are there any case studies of using Replication ID? Does it make sense? Never faced it in my practice, just want to understand its practical application.
Subject: INFO: Replication and GUIDs, the Good, the Bad, and the Ugly Basically don't use GUID as a primary key.
http://www.trigeminal.com/usenet/usenet011.asp?1033Tony
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/Sunday, August 28, 2011 7:18 PM