Click here to Skip to main content
15,892,005 members
Home / Discussions / Database
   

Database

 
QuestionMs-Access Vs Sql-Server 2000 Pin
Naveed Kamboh22-Sep-05 4:37
Naveed Kamboh22-Sep-05 4:37 
AnswerRe: Ms-Access Vs Sql-Server 2000 Pin
miah alom22-Sep-05 5:14
miah alom22-Sep-05 5:14 
AnswerRe: Ms-Access Vs Sql-Server 2000 Pin
Luis Alonso Ramos22-Sep-05 7:16
Luis Alonso Ramos22-Sep-05 7:16 
GeneralRe: Ms-Access Vs Sql-Server 2000 Pin
Naveed Kamboh23-Sep-05 3:01
Naveed Kamboh23-Sep-05 3:01 
QuestionSelect Pin
NormBohana21-Sep-05 15:09
NormBohana21-Sep-05 15:09 
AnswerRe: Select Pin
Christian Graus21-Sep-05 15:38
protectorChristian Graus21-Sep-05 15:38 
AnswerRe: Select Pin
miah alom22-Sep-05 3:26
miah alom22-Sep-05 3:26 
QuestionStored Query in Access Pin
kornstyle21-Sep-05 8:53
kornstyle21-Sep-05 8:53 
I am trying to prevent duplicate records from being appended to my Access database. What I did was created two tables in Access. The first one "NewResultsTable" is populated with new records. I created a Query in Access "Query1" which appends the first database to the second database. The Table "NewResultsTable" is then cleared of all of its records.

The table "TestResultsTable" has three primary keys:TestDate, TestTime, and SerialNumber. So when I run "Query1" while in Access, if all three of those primary keys are the same as any other three primary keys I will get an error message similar to the following.


"Microsoft Access can't append all the records in the append query

Microsoft Access didn't add (Number of records) to the table due to key violations
To ignore the error and run the query, click Yes"


I click yes the records that aren't duplicates are appended to "TestResultsTable". I wrote a small test program in C# and called the "Query1".
When there where no duplicates the "TestResultsTable" is appended to no problem. When there are duplicates I get the following error.

"The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again."


I don't know how to tell Access to continue and run the query. How can I do this? Or would it be easier to write a SQL statement? What would the SQL statement be that would do this same thing?

Thanks to anyone who can help.
AnswerRe: Stored Query in Access Pin
Christian Graus21-Sep-05 15:40
protectorChristian Graus21-Sep-05 15:40 
QuestionUpdate Pin
Illegal Operation21-Sep-05 2:29
Illegal Operation21-Sep-05 2:29 
AnswerRe: Update Pin
Christian Graus21-Sep-05 15:39
protectorChristian Graus21-Sep-05 15:39 
QuestionExpression column in a Datatable not evaluating Pin
convergence21-Sep-05 0:22
convergence21-Sep-05 0:22 
AnswerRe: Expression column in a Datatable not evaluating Pin
sreejith ss nair21-Sep-05 0:49
sreejith ss nair21-Sep-05 0:49 
GeneralRe: Expression column in a Datatable not evaluating Pin
convergence21-Sep-05 2:36
convergence21-Sep-05 2:36 
GeneralThe Solution Pin
convergence21-Sep-05 17:08
convergence21-Sep-05 17:08 
Questiondataset size limits... Pin
l a u r e n20-Sep-05 18:54
l a u r e n20-Sep-05 18:54 
AnswerRe: dataset size limits... Pin
Andy Brummer20-Sep-05 19:46
sitebuilderAndy Brummer20-Sep-05 19:46 
Questionxml schemas... Pin
l a u r e n20-Sep-05 17:11
l a u r e n20-Sep-05 17:11 
AnswerRe: xml schemas... Pin
Andy Brummer20-Sep-05 19:54
sitebuilderAndy Brummer20-Sep-05 19:54 
QuestionBest practices for user defined fields Pin
econner20-Sep-05 16:42
econner20-Sep-05 16:42 
AnswerRe: Best practices for user defined fields Pin
Edbert P20-Sep-05 18:27
Edbert P20-Sep-05 18:27 
AnswerRe: Best practices for user defined fields Pin
Andy Brummer20-Sep-05 20:01
sitebuilderAndy Brummer20-Sep-05 20:01 
QuestionDatabound ComboBox Selection Problems Pin
Glenn E. Lanier II20-Sep-05 15:33
Glenn E. Lanier II20-Sep-05 15:33 
AnswerRe: Databound ComboBox Selection Problems Pin
sreejith ss nair22-Sep-05 1:06
sreejith ss nair22-Sep-05 1:06 
AnswerRe: Databound ComboBox Selection Problems Pin
Glenn E. Lanier II2-Mar-06 8:36
Glenn E. Lanier II2-Mar-06 8:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.