Avatar billede puppetmaster Nybegynder
25. marts 2002 - 14:24 Der er 7 kommentarer og
1 løsning

Sammenkædede tabeller

Jeg har 2 databaser, den ene indeholder oplysninger om patienterne, så som CPR, fornavn, efternavn, adresse osv., den anden indeholder nogle ydelser til de enkelte patienter. patientdatabasen skal bruges til andet og jeg ikke gider at indtaste/opdatere hver gang der kommer nye patienter til, er jeg interesseret i at ydelsesdatabasen er kædedet sammen med patientdatabasen.
Der er dog det problem, at hvis jeg for en patients ydelse ændrer CPR nummeret, ændres det også i patiensdatabasen! Ikke lige det jeg ville have den til. Any ideas? (jeg har oprettet en relation mellem den sammenkædede tabel og ydelsestabellen)
Avatar billede terry Ekspert
25. marts 2002 - 19:24 #1
hi puppetmaster
I am not sure I understand the problem! How are your two tables linked, are you using CPR number? What us getting changed in the "ydelse" table, CPR number?

If your tables are normalizes then CPR -number should exist as primary key in (for example) "patient" table and as the foreign key in "ydlese" table.

Why should the CPR number change in the ydlese table, isnt it the same patient????
Avatar billede puppetmaster Nybegynder
26. marts 2002 - 08:45 #2
I'd be happy to mail you the table layout, if that could help clarifying things.....
Avatar billede puppetmaster Nybegynder
26. marts 2002 - 08:55 #3
I've uploaded a jpeg of the relations at:
http://www.praetorian.dk/images/tables.jpg

The CPRNR table is the linked table......
Avatar billede terry Ekspert
26. marts 2002 - 09:38 #4
I am still not sure what the problem is! The relationships look OK to me, but I can see exactly how they are being used in you programs.


WHY should a CPR number get changed in the "ydelse" table? This is the primary key we are talking about!
Avatar billede puppetmaster Nybegynder
26. marts 2002 - 10:26 #5
Terry, I use the formguide to make 3 forms based on the 3 tables that you see in the pic.......(sammenkædede formularer).......the form cprnr is the "top-most" form, the Screeningform is the level below that and the mammografiform is the lowest form (if you know what I mean).........IF I make any changes to the data presented in the cprnr form, the data changes in the related table, which is the "linked table".......I do not want this.........I know I can prevent "dataindtastning" on a per field level in the form.....but the user can STILL open the table and change the data......I thought that when you link to tables outside your database, the "remote" data couldn't be changed.....but they can.....
Avatar billede terry Ekspert
26. marts 2002 - 12:00 #6
If I understand you correctly you want to STOP users from alteing data in the CPRnr table which is linked from another database, is that correct? You can make the from read only so that users cant alter data here, but as  you say they can alter data directly in the table. You can ensure that the database window isnt displayed and also make you own menu so that they cant open it, but again if they WILL alter data for some reason they will find a way.

I normally make my own menu's and hide the standard menu's and database window, and then make it all into an MDE file. This stops them playing around to some degree.
Avatar billede puppetmaster Nybegynder
26. marts 2002 - 12:36 #7
I see...........but I've never "dabbled" in making my own menues........don't know where to start......you ARE talking about replacing the Files, Edit and so on menues, right?
Avatar billede terry Ekspert
26. marts 2002 - 12:41 #8
yes!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester