Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © Andrew Couch 2007 All rights reserved. Access Tables Without Keys & Views How To Manage Keys On Access Tables Andrew Couch ASC Associates.

Similar presentations


Presentation on theme: "Copyright © Andrew Couch 2007 All rights reserved. Access Tables Without Keys & Views How To Manage Keys On Access Tables Andrew Couch ASC Associates."— Presentation transcript:

1 Copyright © Andrew Couch 2007 All rights reserved. Access Tables Without Keys & Views How To Manage Keys On Access Tables Andrew Couch ASC Associates

2 Contents  What are Views ?  A Table Without A Key  A Big Limitation On Views & A Table Without A Primary Key  Automatic Addition Of Keys  Adding Keys Back Into Access (Batch Transfer Mode)  Commissioning and Adding Keys

3 What Are Views ?  They are like queries, but have a number of restrictions.  They also have some additional benefits.  Don’t image you will simply convert all your queries into views.  Views in databases were primarily designed to implement security, so you may like to think whether this applies to you!  Views can also mimic the layering of queries on top of queries that appeals to Access Developers.

4 A Table Without A Key  We would recommend, that all tables, even temporary tables have a primary key, even if it just means adding an autonumber (which the tool does for you if desired).  If you don’t then when you link the table, Access will prompt you for a field combination that is unique, to enable the table to be updated.

5 RE-Linking The Table/View  Similarly when you link a view Access asks you need to indicate the unique field in the view to provide updateability over the view You will possibly be distressed when programmatically refreshing a linked view or linked un-keyed table, to find that updateability is lost!! You will possibly be distressed when programmatically refreshing a linked view or linked un-keyed table, to find that updateability is lost!!  Which is why the tool when linking to an un-keyed table does not allow it to be updateable.  So the moral is, be careful when using views, that they fulfil your needs, and slap a key on all un-keyed tables!  In general it is difficult to see how an un-keyed table can take advantage of relational database design (except for some pure server processing tasks), and you never know when you will want to start joining to the un-keyed table (which can lead to some performance issues).

6 Option To Add Keys Or in the Full-Menus

7 MANIFEST  The tools MANIFEST, contains a list of all your Tables, Fields, Rules and Relationships.  A change in the MANIFEST is not a physical change to your database, but a change to how your database gets mapped to SQL Server.

8 Illegal Keys  If you have a table with a Primary Key of type hyperlink (maps to SQL Server like a memo field)  Or a Primary Key memo (unlikely)  Then this will be disallowed, as these either MAP to IMAGE or VARCHAR(MAX) data types, which can not be indexed  The tool will automatically remove the key from its MANIFEST and if desired replace it with an autonumber.

9 Change Log Notifications

10 Handling Tables Missing A key  The tool will first check to see if the table has an autonumber, and if it has it makes this the primary key in the MANIFEST  If not then a new field called pk_tablename is created in the MANIFEST, of type autonumber.

11 Review Fields – Full Menus  Here an illegal Hyperlink automatically gets replaced in the MANIFEST with an autonumber primary key.

12 Auto numbers Are Unique ? Change Log Notification !  Auto numbers are not necessarily unique, if you created a temporary table using a make table query! You can end up having duplicates (depending on how you use the table).  So if a non-keyed table has an existing autonumber which is changed in the MANIFEST to be a primary key, you will receive a warning in the Change Log that you must ensure that it is unique!  We could detect this, but there is not a lot we could do about it!

13 Change Log  The Change Log displays all changes made to the database MAP in the MANIFEST  The log can be filtered by system, or by notification type, and instantly reported into an Excel Spreadsheet.

14 Manage Added keys  You can remove the key from the MANIFEST.  Or you can add the key to your Access Table (Why? Read On)

15 Block Transfer  This only applies to large tables.  Ever transferred 500,000 rows ?  Fancy a progress report ?  If so then by adding the key back into the Access Table, MUST automatically starts block transfer mode.  In Block Transfer Mode batches of records are transferred, and you get a progress update. Nice to see the progress, when you intend to add a key to a table.  MUST with direct transfer will typically hit 1 G Byte of Access data in about 3 hours (using batch scripts this comes down to about 20 minutes), so progress reporting is important!

16 Commissioning  After you have upsized a system, possible more than once, and you come to finally commission the system. The MANIFEST knows if you added keys to AccessTables, and will remind you to repeat this important step.

17 Best Advice  Report out all the tables missing keys (using the Reports Menu) and add them into you databases before Migration.


Download ppt "Copyright © Andrew Couch 2007 All rights reserved. Access Tables Without Keys & Views How To Manage Keys On Access Tables Andrew Couch ASC Associates."

Similar presentations


Ads by Google