Can I use combination of 2 fields as a Primary Key?

  • Thread starter Thread starter Mota
  • Start date Start date
M

Mota

Hello;
I defined 2 field of [Table1] as a unique index for this table.Fields are
[SQ]+[SN] and the index name is SQN.
My purpose of making this index is to use it as One side of a One-To-Many
relationship,then force cascade delete for it.But i dont know how to do
this.
Is it possible to use a combined Index,instead of a field,for such
relationships?Any help is appreciated.
Thank you in advance.
 
Yes, it is possible.
In the Index Dialog Box, at the bottom, set Primary Key to True.

HTH
 
Ok;
Then i want to use this index as One side of a One-To-Many relationship and
force Referential integrity>Cascade Delete for this relation.This is my goal
of making this index.Is it possible?
Thank you for your attention.


MacDermott said:
Yes, it is possible.
In the Index Dialog Box, at the bottom, set Primary Key to True.

HTH

Mota said:
Hello;
I defined 2 field of [Table1] as a unique index for this table.Fields are
[SQ]+[SN] and the index name is SQN.
My purpose of making this index is to use it as One side of a One-To-Many
relationship,then force cascade delete for it.But i dont know how to do
this.
Is it possible to use a combined Index,instead of a field,for such
relationships?Any help is appreciated.
Thank you in advance.
 
Yes, this is possible.
Are you having some problem doing this?
If so, please tell us what you're doing, what's happening that you don't
want, and/or what isn't happening that you do want.


Mota said:
Ok;
Then i want to use this index as One side of a One-To-Many relationship and
force Referential integrity>Cascade Delete for this relation.This is my goal
of making this index.Is it possible?
Thank you for your attention.


MacDermott said:
Yes, it is possible.
In the Index Dialog Box, at the bottom, set Primary Key to True.

HTH

Mota said:
Hello;
I defined 2 field of [Table1] as a unique index for this table.Fields are
[SQ]+[SN] and the index name is SQN.
My purpose of making this index is to use it as One side of a One-To-Many
relationship,then force cascade delete for it.But i dont know how to do
this.
Is it possible to use a combined Index,instead of a field,for such
relationships?Any help is appreciated.
Thank you in advance.
 
My problem is how to put a PK index instead of a PK field,as the left table
field name,when creating a new relation in the relationships window.But i
have not access to the index name there and just field names are listed.In
detail:
In the relationships window,i want to create a new one to many relation
between two tables.The left table doesnt have a field as its PK,and has a
unique index named SQN that its Primary Key property is set to true (as you
mentioned above)and is made from 2 fields of the left table.Now i want to
define this index as the left table field,instead of a separate field.In
other word,i want to use an index (and not a field) for the one side of a
one to many relationship,in the relationshipe window.But when i open
combobox containing left table field names,i cant see SQN (index name)
between field names.So how to put SQN as left field name?
Thank you again for your help.

MacDermott said:
Yes, this is possible.
Are you having some problem doing this?
If so, please tell us what you're doing, what's happening that you
don't
want, and/or what isn't happening that you do want.


Mota said:
Ok;
Then i want to use this index as One side of a One-To-Many relationship and
force Referential integrity>Cascade Delete for this relation.This is my goal
of making this index.Is it possible?
Thank you for your attention.


MacDermott said:
Yes, it is possible.
In the Index Dialog Box, at the bottom, set Primary Key to True.

HTH

Hello;
I defined 2 field of [Table1] as a unique index for this table.Fields are
[SQ]+[SN] and the index name is SQN.
My purpose of making this index is to use it as One side of a One-To-Many
relationship,then force cascade delete for it.But i dont know how to
do
this.
Is it possible to use a combined Index,instead of a field,for such
relationships?Any help is appreciated.
Thank you in advance.
 
Just enter both fields (which make up the index) on each side.

Mota said:
My problem is how to put a PK index instead of a PK field,as the left table
field name,when creating a new relation in the relationships window.But i
have not access to the index name there and just field names are listed.In
detail:
In the relationships window,i want to create a new one to many relation
between two tables.The left table doesnt have a field as its PK,and has a
unique index named SQN that its Primary Key property is set to true (as you
mentioned above)and is made from 2 fields of the left table.Now i want to
define this index as the left table field,instead of a separate field.In
other word,i want to use an index (and not a field) for the one side of a
one to many relationship,in the relationshipe window.But when i open
combobox containing left table field names,i cant see SQN (index name)
between field names.So how to put SQN as left field name?
Thank you again for your help.

MacDermott said:
Yes, this is possible.
Are you having some problem doing this?
If so, please tell us what you're doing, what's happening that you
don't
want, and/or what isn't happening that you do want.


Mota said:
Ok;
Then i want to use this index as One side of a One-To-Many relationship and
force Referential integrity>Cascade Delete for this relation.This is my goal
of making this index.Is it possible?
Thank you for your attention.


Yes, it is possible.
In the Index Dialog Box, at the bottom, set Primary Key to True.

HTH

Hello;
I defined 2 field of [Table1] as a unique index for this
table.Fields
are
[SQ]+[SN] and the index name is SQN.
My purpose of making this index is to use it as One side of a One-To-Many
relationship,then force cascade delete for it.But i dont know how to
do
this.
Is it possible to use a combined Index,instead of a field,for such
relationships?Any help is appreciated.
Thank you in advance.
 
I did it.Thank you.
But now,although 3 data types are Long (2 for fields make up index and 1 for
the foreighn key field in the right hand table), i can not select Cascade
Delete in this relationship.Is it a rule that when the Primary Key of a
table is an index rather than a field,we can not enforce referential
integrity when using this index in a one to many relation?
If indices can have referential integrity too,whats the problem?
More thanx.

MacDermott said:
Just enter both fields (which make up the index) on each side.

Mota said:
My problem is how to put a PK index instead of a PK field,as the left table
field name,when creating a new relation in the relationships window.But i
have not access to the index name there and just field names are
listed.In
detail:
In the relationships window,i want to create a new one to many relation
between two tables.The left table doesnt have a field as its PK,and has a
unique index named SQN that its Primary Key property is set to true (as you
mentioned above)and is made from 2 fields of the left table.Now i want to
define this index as the left table field,instead of a separate field.In
other word,i want to use an index (and not a field) for the one side of a
one to many relationship,in the relationshipe window.But when i open
combobox containing left table field names,i cant see SQN (index name)
between field names.So how to put SQN as left field name?
Thank you again for your help.

MacDermott said:
Yes, this is possible.
Are you having some problem doing this?
If so, please tell us what you're doing, what's happening that you
don't
want, and/or what isn't happening that you do want.


Ok;
Then i want to use this index as One side of a One-To-Many
relationship
and
force Referential integrity>Cascade Delete for this relation.This is
my
goal
of making this index.Is it possible?
Thank you for your attention.


Yes, it is possible.
In the Index Dialog Box, at the bottom, set Primary Key to True.

HTH

Hello;
I defined 2 field of [Table1] as a unique index for this table.Fields
are
[SQ]+[SN] and the index name is SQN.
My purpose of making this index is to use it as One side of a
One-To-Many
relationship,then force cascade delete for it.But i dont know how
to
do
this.
Is it possible to use a combined Index,instead of a field,for such
relationships?Any help is appreciated.
Thank you in advance.
 
Back
Top