![]() |
| ||
| Help database design Hi I am trying to insert data into 1 of my table and I get this error: Microsoft Access can't append all the records in the append query. Microsoft Access set 0 fields to Null due to type conversion failure, and it didn't add 1 records to the table due to key violation, 0 records due to lock violation, and 0 records due to validation rule violation. My design is: Create table MANUFACTURER( This occurs when I try to add data into the car or CAR_OPTIONS table Please help.. |
| ||
| Re: Help database design Originally I thought that this was in the wrong forum. But I was wrong. Your query regarding the foreign key violations should be fairly trivial if you trace back through all of the tables ensuring that the correct data is in place BEFORE you try to insert the CAR row. Also you might want to have a look at the CAR_OPTIONS table. It has a PK on the CAR_ID value. PK's are (usually) unique, while the name CAR_OPTIONS implies multiple rows for each car. This would give rise to the Key violation error you report. However now the Database Design problem. Looking at your SQL code I see that you have FK releationships from the CAR table to the MANUFACTURERS table and the MODELS table. Surely a MODEL is owned by the MANUFACTURER and you then only need to FK to the MODELS table. Yes; different car models MIGHT have the same name, bu they WILL have different MANUFACTURERS and thus a different MODELS.MODEL_ID. I do not understand the OPTIONS and CAR_OPTIONS system(s). An option for a car (real world) may have a name shared by many other options. i.e. 'Metalic Paint' or 'Air Conditioning'. While the NAMES of these options may be the same from manufacturer to manufacturer, the actual OPTIONS themselves are not. Thus I would have expected the OPTIONS table to include the MODEL_ID and be FK'ed on this. Then I would expect the CAR_OPTIONS to just hold the CAR_ID and the OPTION_ID. FK's can be placed on both of these columns but are not usually necessary. Hope that you can understand my meanderings and that they help. :) |
| All times are GMT -4. The time now is 4:05 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC