Forum

Forum (https://www.ms-office.gr/forum/)
-   Access - Ερωτήσεις / Απαντήσεις (https://www.ms-office.gr/forum/access-erotiseis-apantiseis/)
-   -   [ Πίνακες ] the insert statement conflicted with the foreign key constraint fk the conflict occur (https://www.ms-office.gr/forum/access-erotiseis-apantiseis/5671-insert-statement-conflicted-foreign-key-constraint-fk-conflict-occur.html)

gianniskar 14-10-20 11:54

the insert statement conflicted with the foreign key constraint fk the conflict occur
 
Καλησπερα.Για ποιο λογο μπορει να εχω αυτο το σφαλμα

Εχω 3 πινακες : [Users] με πεδια Username , Password , Role , ID
[Doctor] με πεδια Ονομα , Επωνυμο , ID
[AssistDoctor] με πεδια Ονομα , Επωνυμο , ID

Εχω φτιαξει ενα Foreign Key (UsersID) στον πινακα [Users].


Στoν sql server συνδεονται οι πινακες [Doctor],[AssistDoctor] το (Primary Key) τους με το Foreign Key (UsersID)

Η λειτουργεια ειναι οταν παω να κανω ενα καινουργιο Χρηστη απο την φορμα μου,να διαλεγω τι ρολο θα εχει ο χρηστης.Πχ ανα διαλεξω να εχει (role) doctor ,ανοιγει μια φορμα οπου συμπληρωνεις τα στοιχεια (ονομα,username κλπ) .Σε αυτην την φορμα μεσα υπαρχει ο Πινακας [Doctor] και ο πινακας [Users].Οταν παω να κανω αποθηκευση εχω το συγκεκριμενο error:
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_tblUsers_AssistDoctor". The conflict occurred in database "db", table "dbo.tblAssistDoctor,collum 'ID'". The statement has been terminated.


Η ώρα είναι 10:07.

Ms-Office.gr - ©2000 - 2026, Jelsoft Enterprises Ltd.


Search Engine Optimization by vBSEO 3.3.2