[QUOTE=the PC apeman]
Amateur SQL user here. I’m trying to define two tables in MS Access with a one-to-one relationship using VBA & SQL. Here’s what I’ve got so far…
CREATE TABLE Games (GameID long PRIMARY KEY, Status byte DEFAULT 0, LastUpdate datetime)
CREATE TABLE Comments (GameID long PRIMARY KEY CONSTRAINT PK_GameID REFERENCES Games (GameID), Comment memo)But this produces a one-to-many relationship. What am I doing wrong? Thanks for helping.
[/QUOTE]
Technically, the relationship is one-to-many. However, by defining the same identical value as the primary key in the second table, you have made it one-to-one, since only one record with that id can exist.