A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Table Wizard Does Not Set Relationship if Foreign Key and Primary Key Name Do Not Match Exactly in Case.



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old October 12th, 2004, 11:05 PM
HDW
external usenet poster
 
Posts: n/a
Default Table Wizard Does Not Set Relationship if Foreign Key and Primary Key Name Do Not Match Exactly in Case.

Described below is what I would suspect to be a Microsoft Table Wizard
issue. It occurs with any table creation and setting foreign key
relationships. Has anyone noticed or seen this issue addressed by Microsoft?



Please excuse the lengthiness, but I wanted the issue to be clear to all.



HDW





ACC2003: Table Wizard Does Not Set Relationship if Foreign Key and Primary
Key Name Do Not Match Exactly in Case.



SYMPTOMS



When you use the new table wizard to create a table and the foreign key
column name does not match the primary key in a foreign table exactly in
case, the table relationships are not set even though the table wizard
declares that the relationship was set.



MORE INFORMATION



Steps to Reproduce Problem

-----------------------------------



Create Categories Table in Design View



1. Create a new table in Design View.

2. Add the following fields to the table:

Table:

-----------

Field Name: Categoryid (be sure to type the characters "id" in lowercase).

Data Type: AutoNumber

FieldName: CategoryName

Data Type: Text



3. Close and save the table as Categories.



CREATE PRODUCTS TABLE WITH TABLE WIZARD



1. Click on Tables in the Objects window.

2. Click on New in the database toolbar.

3. Select Table Wizard in the New Table form and click the OK button.

4. Click on Products in the Sample Tables list.

5. Press the button to add all sample fields to the field in my new
table list.

6. Press the Next button twice.

7. Select the text "not related to Categories" in the "My new Products
table is" list box.

8. Press the Relationships. button.

9. Select the option button with the text "One record in the
'Categories' table will match many records in the Products table. (Note the
statement on this form: "The table wizard will add a 'Categorid' field to
the Products table, and then create this relationship."

10. Click the OK button.

11. Note that the list box entitled "My new Products table is." now states
'related to Categories.

12. Press the Next button and then the Finish button.



VIEW TABLE RELATIONSHIPS



13. Open the Relationships form by selecting Tools|Relationships from the
menu bar.

14. Notice that no relationship connecting line is drawn between the two
tables for columns Categories!Categoryid and Products!CategoryID.



STEPS TO SUCCESSFULLY CREATE RELATIONSHIPS



15. Delete the existing Products tables created in the instruction steps
above.

16. Repeat steps 1 through 5 in Create Products Table with Table Wizard
above.

17. Before pressing the Next button and the remainder of steps 6 through
12, select the CategoryID field name in the "Field in My new Table" list.

18. Press the Rename Field. button.

19. Type Categoryid in the Rename Field form and be sure to type "id" in
lower case letters.

20. Then press the OK button.

21. Continue with steps 6 through 12 above.

22. Repeat steps 13 and 14 for View Table Relationships and notice the
connecting relationship line between these two fields.




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:33 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.