Outlook Contact primary key for linked Access database

Posted on 2007-07-28
1 Ratings
Last Modified: 2013-11-29
I'm makeing a simple order data base in Access with customer infromation from Outlook-contacts. I have linked Outook-contacts to an Access-Contacts database but need a primary key for the one-Customer to Many-orders relationship.  I cannot seem to add a primary key in the linked Access database.  How can I define a unique relationship or add a primary key to either Outlook or Access?
Question by:rbhmesqu
    LVL 76

    Expert Comment

    by:David Lee
    Hi, rbhmesqu.

    I don't know of a way to add a primary key to the linked contacts table.  How about using a query to find all Access records that match the current contact's name?
    LVL 92

    Accepted Solution

    Hello rbhmesqu,

    A little under two years back I created a contact mgmt database for one of our managers.
    I included a synchronization routine that worked something like this:

    1) In Access, each contact had a record in the Contacts table, with an autonumber
    primary key, and just a few key details like name, company, business phone, and

    2) The Access db also had a parameters table that stored, among other things, the
    date/time of the last sync

    3) When I ran the routine, Access would use Outlook automation to enumerate the
    ContactItems.  If it found a ContactItem with 'last modified date' greater than that
    last sync date, then I updated the associated Access record.  To tie the ContactItem to
    the Access record, I think I co-opted one of the little-used fields like User FIeld 1or
    Customer ID to store the primary key value.  (And thus, a ContactItem with no data
    for that field would be a new contact; I'd add that to the Access db, grab the primary
    key value, and populate it in Outlook)

    Unfortunately I doubt I ever backed up the application, and the computer I built it on
    gave up the ghost a couple of months ago, so I cannot send it to you.  I can say it
    was based on the Access template for contact mgmt.


    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    " I cannot seem to add a primary key in the linked Access database."

    Can you open the 'Access-Contacts database' ?  If can open it, then you should be able to modify the table design / relationships as necessary to add a Primary key.

    If for some reason you do not have 'access' to the MDB, then you cannot modify the design of tables 'remotely', ie ... in the linked table.

    Can you open the MDB?

    LVL 92

    Expert Comment

    by:Patrick Matthews

    Looks like the Asker is using an Exchange data store as a linked table.  That being
    the case, you cannot alter the structure of the linked data store...



    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    Don't know ... guess we need him to tell us ...

    This "" I cannot seem to add a primary key in the linked Access database." is a little ambiguous :-)


    Author Comment

    Thank you all for your comments.
    Yes I am using an Exchange data, I guess that explains why I can't modify the structure of the linked Access database.  I thought perhaps Outlook would somehow provide a unique field or something I could use for one.    I did try just importing the data instead of linking it, but now I have to figure out a way to import only new additions or changes to the Outtlook contacts data. Marthewspatrick seem to have a unique approach.

    Expert Comment

    Regarding matthewspatrick's solution, is ContactItems a separate table?  If so, is it the same as the "parameters table"?  Also, what is "Outlook Automation"?



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Use email signature images to promote corporate certifications and industry awards.
    Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now