OVH Cloud OVH Cloud

Urgent: Create Table!

1 réponse
Avatar
Carmen
Bonjour tous !

I have a table Corres. The column no_control is Primary=20
Key's Corres and the index is named IndexP. Its type is=20
autonumeric. The primary Key no_control is a foreing Key=20
into the tables Copia and Destinatario. I have the=20
constraint:
Corres1 =3D Destinatario.no_control to Corres.no_control=20
[update cascade, delete cascade]
and Corres2 =3D Copia.no_control to Corres.no_control=20
[update cascade, delete cascade]=20

The problem is: I have to made a Macro to restore the=20
column Corres.no_control to 1 and clean the table. This=20
macro will be available for user that do not known=20
anything about Access.=20

I have those steps:

1. Delete * from corres=20
2. ALTER TABLE destinatario DROP CONSTRAINT corres1
3. ALTER TABLE copia DROP CONSTRAINT corres2
4. ALTER TABLE CORRES DROP CONSTRAINT [IndexP]
5. ALTER TABLE CORRES DROP [no_control]
6. ALTER TABLE Corres ADD no_control Numeric,CONSTRAINT=20
IndexP Primary Key (no_control)
7. ALTER TABLE Destinatario ADD CONSTRAINT corres1=20
FOREIGN KEY (no_control) REFERENCES Corres (no_control)=20
[ON DELETE CASCADE ON UPDATE CASCADE]
8. ALTER TABLE Copia ADD CONSTRAINT corres2 FOREIGN KEY=20
(no_control) REFERENCES Corres (no_control) [ON DELETE=20
CASCADE ON UPDATE CASCADE]

But I have two problems. In the step 6 I don't know how to=20
create the column no_control with autonumeric type =E0 la=20
place de Numeric.
In the step 7 and 8 the part "ON DELETE CASCADE ON UPDATE=20
CASCADE" don't work.=20

est-ce=20

1 réponse

Avatar
3stone
"Carmen"
Bonjour tous !


Bonjour aussi !

C'est plus intéressant en anglais, sur un forum FR ?

;-))


--
A+
Pierre (3stone) Access MVP
-------------------------------------------------------
Bien démarrer ? c'est ici http://users.skynet.be/mpfa/
( Je ne réponds pas aux emails qui concernent Access )
-------------------------------------------------------