Results 1 to 13 of 13
  1. #1
    BeachRock is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    3

    Question Referential integrity question


    I'm only beginning to learn Access and I'm wondering why or, for what reason would you ever not enforce referential integrity between table relationships and enable both cascade update and delete? It seems like these should be turned on automatically and you would want to turn them off for those few relationships that you don't need them for instead of vice-versa. I don't understand why you wouldn't always turn it on with both cascade update and delete enabled.

    Thanks for any insight you can shine down upon me.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Access provides an RDBMS. So, open Access to behave as a management console for your database (Access does other things to). One responsibility of an RDBMS is to manage constraints on the data. Access offers some tools via the Relationships Window to maintain referential integrity. If you choose not to use the tools offered by Access, you need to manage referential integrity another way.

  3. #3
    BeachRock is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    3
    Thanks for the reply, ItsMe. If I understand correctly, you are suggesting that referential integrity and cascade update and delete should always be used or, they should otherwise be managed in some other way, like by using SQL or other RDBMS. So, the only reason to not let Access manage them is if they are being managed by something else?

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by BeachRock View Post
    ... the only reason to not let Access manage them is if they are being managed by something else?
    The simple answer is, yes. To be more specific, you can have a hybrid of ways. I look at Access as being two basic things. On one side, you have an RDBMS. On the other side, you have an Application Development tool (in the case of Access, a Rapid Application Development tool (RAD)).

    If Access is not managing constraints on the RDBMS side, you need to manage them from the Application side.

    I prefer to not use the Relationships window for anything at all. I diagram my entities on third party software and I manage many constraints via VBA.

    You need to understand what works for you. I have my ways and others may use a different approach.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    Interesting comments on cascade update here.
    I like to work from a data model and test it with sample data and scenarios before developing. I use Referential Integrity via relationships and let the database do what it was designed to do. However, I see lots of people who do not know what relationships are using Access and other database systems. But then I see lots of people who start with a form and try to develop from that.
    Maintaining integrity via vba is possible, just more work in my view.

    Suffice it to say --different approaches by many people.
    Attitudes change with experience.
    I suggest you look for best practices and use that as a guide. And be prepared to change as your skills evolve.

    For good access tips see Allen Browne

    There are many excellent free videos on youtube that can reduce learning time.

  6. #6
    BeachRock is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2016
    Posts
    3
    Thanks, ItsMe. I understand completely. I'm sure as I become more adept at the basics of Access, I'll delve into other ways to do things in order to provide some function I can't seem to make Access do for me otherwise.

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    ItsMe,

    What 3rd party software are you using for modelling?

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I have been using this for a little over a year now.
    https://www.lucidchart.com/

    So it does not interact with your development environment. It is really just an aid to draft stuff and that is attractive to me. This works well as a whiteboard and for Access. Otherwise, I will rely on Visual Studio and the MVC Entity Framework.
    http://www.asp.net/mvc/overview/gett...vc-application

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by BeachRock View Post
    Thanks, ItsMe. I understand completely. I'm sure as I become more adept at the basics of Access, I'll delve into other ways to do things in order to provide some function I can't seem to make Access do for me otherwise.
    Good luck with your endeavors and welcome to the forum.

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    I've been using ErWin Community Edition to build some draft models in some responses. I used it years ago when it was owned by Logic Works. I'm trying to learn how to properly move from model to ODBC generic database. I have some code to take generated scripts etc. and create an Access database, but the product can do much more. There are some youtube videos but most is geared to SQL Server, Oracle.... Access used to be a target database, but that has been dropped in the releases and different owners (All Fusion, Computer Associates and now ERWin a separate spinoff) since we first brought it into a government organization in the early '90s.
    My use and interest now is more hobby and assistance in the forum(s).

  11. #11
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    @ orange
    That might be something of interest to me. I have been using various tools via SQL Server Management Studio, Visual Studio, and custom tools that use either of the development environments.

    A typical scenario for me is to generate SQL Server script from an Access file using a free utility (Microsoft SQL Server Migration Assistant for Access). So, I might start with an ERD and use Access to bring the ERD to life. Then after testing the ERD with queries, I will use the utility to generate the SQL Server script. The term, "Migration Assistant", is a bit of a misnomer because it is not useful for migrating data. It is only good for basic table structure. And even with that, you want to come back and clean things up.

  12. #12
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    I haven't used these --- SQL Server Management Studio, Visual Studio.
    Since retiring, I'm not in the environment to undertake them, but every now and then....

  13. #13
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by orange View Post
    ...
    Since retiring, I'm not in the environment to undertake them, but every now and then....
    I believe a prerequisite for me retiring will be working with the Universal Windows Platform (UWP) and .NET technology stacks.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Referential Integrity
    By YunqHero in forum Forms
    Replies: 4
    Last Post: 12-17-2012, 05:05 PM
  2. Referential Integrity
    By Paul H in forum Database Design
    Replies: 3
    Last Post: 11-14-2011, 03:07 PM
  3. Referential Integrity
    By Desstro in forum Database Design
    Replies: 4
    Last Post: 06-13-2010, 01:29 PM
  4. Referential Integrity
    By U810190 in forum Access
    Replies: 1
    Last Post: 03-29-2010, 05:21 PM
  5. Referential Integrity
    By jbarrum in forum Access
    Replies: 5
    Last Post: 01-14-2010, 09:04 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums