Defining a Primary Key for Web Databases
Every table in a relational database should have a primary key, and web databases are no exception. In web databases, however, you must follow the structure of SharePoint lists, which only allows the SharePoint ID field as the primary key. From a certain perspective, this makes defining a primary key in web databases quite simple-Access automatically creates the primary key field, the ID field, for you whenever you create a new web table. You cannot delete this field from your web table, but you can rename the ID field to something more to your liking, such as VendorID or InvoiceID.
If you're an experienced Access developer, you might find the ID primary key restriction to be very limiting. What if you want to create a multi-field primary key and set it to be unique, as you can for client databases? While it's true you cannot define a unique multifield primary key in SharePoint lists, you can achieve the same functionality by using table events, which is a new feature in Access 2010.
In this tutorial:
- Designing Web Tables
- Working with the Web
- Creating a New Web Database
- Creating a New Empty Web Database
- Creating Your First Simple Web Table by Entering Data
- Creating a Web Table Using Application Parts
- Using Data Type Parts
- Creating Web Tables in Datasheet View
- Choosing Web Field Names
- Understanding Web Field Data Types
- Setting Field Properties for Web Databases
- Creating Calculated Fields
- Defining Field Validation Rules for Web Databases
- Defining a Table Validation Rule for Web Databases
- Defining a Primary Key for Web Databases
- Understanding Other Web Table Properties
- Creating Lookup Fields in a Web Database
- Creating Relationships Using Lookup Fields
- Defining a Restrict Delete Relationship
- Defining a Cascade Delete Relationship
- Using the Web Compatibility Checker
- Analyzing the Web Compatibility Issues Table
- Preparing a Client Database for the Web