Table Connection


A

ak

Dear experts,
Here I have a very important question. Once I connect table to table
sometimes it shows 1 to 1. In the same time I need it 1 to many. How come
that shows one to one? What is the technique in it? How it works?

Besides this I have another question. For example table1 and table2.
In query I can see field size as : integer and long integer. What is
integer and what is long integer. I dont know this. Please explain. I am a
top intrested student in msaccess who is studying more than 7 years. In
table1 in which situation I have to mention field size integer and long
integer? If so what I have
to mention in table2 ? Would appreciate your response.
 
Ad

Advertisements

A

Allen Browne

A1. One-to-one
When you create a relationship between 2 tables, Access looks at how the
fields are indexed. If it's the primary key (or a unique index), it knows
that you can only have that value in ONE record, so it determines that's the
ONE side of the relationship.

If the field on the other side is uniquely indexes as well, you can have
that value in only ONE record there as well. Hence it reports it as a
one-to-one relationship. If this happens when you don't expect it, you need
to change the index on the table that should be in the MANY side of the
relation, so it is not uniquely indexed.

A2. Integer vs Long.
In Access an Integer means a whole number up to a maximum of 32767 (i.e.
signed, 16-bit.) A Long Integer is a signed 32-bit number, so handles any
whole number up to 2 billion.

These days, I suggest you use Long Integer unless you have a special reason
to use the smaller type.

If you want to create a relationship between tables, you need to use the
same type on both sides. The default AutoNumber is a long integer, so a
foreign key that relates back to an AutoNumber needs to be a Long Integer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top