In Access, I am able to set warnings to false when running an Insert query that bumps into a duplicate index warning. When I do that, the insert query will go ahead and insert records that do not violate the index and just ignore the ones that do. When attempting this same thing from Alpha, the query will not execute because my database sends back the error message with the index warning and I don't know how to tell it to do it anyway.
When running an insert query in Access that has index key violations, the warning will read 'it didn't add 46 records due to key violations...Do you want to run the action query anyway?' . If you click Yes, the query will run and all records that did NOT violate the index WILL be inserted (which is what I want). As I said, in my Access app code, I set that warning to false so that the user does not see the warning. By setting it to false, it is the same as clicking Yes on the warning message, so the non violating records do get inserted.
In Alpha, here is the error message sent back from Access: http://screencast.com/t/kagJIldpJfMQ and I don't know how to tell it to run the insert query anyway.
Reason for this: If there are new records added to a parent table, I often want to make sure that a child table has a record for every new record in the parent before opening the child table. For example, I have a parent table that is a set of Cost Codes. Then I have a child table that is a Job Budget table made up of records that have a Job Code and a Cost Code with an index that prevents a duplicate record with same Job Code and Cost Code. Before opening a job budget, I want to make sure any new Cost Codes have been added to that budget, so in Access I run an insert query that tries to append all Cost Codes to the child budget table with the appropriate Job Code. I expect that it will produce the duplicate index error, but am able to get around it in Access, and insert only records that do not violate the unique index (ie, the new cost codes). I do not want to insert records to the budget table for all jobs at the time a new cost code is set up because some jobs may not have budgets yet, and I don't want to create budget records for those jobs yet (since creating a new job budget is done based on additional calculated criteria gathered from the Jobs table).
Well, this is probably too complex or confusing, but just thought I'd throw this out there in case there are any Access to Alpha gurus that have dealt with this before. Thanks for any advice.
When running an insert query in Access that has index key violations, the warning will read 'it didn't add 46 records due to key violations...Do you want to run the action query anyway?' . If you click Yes, the query will run and all records that did NOT violate the index WILL be inserted (which is what I want). As I said, in my Access app code, I set that warning to false so that the user does not see the warning. By setting it to false, it is the same as clicking Yes on the warning message, so the non violating records do get inserted.
In Alpha, here is the error message sent back from Access: http://screencast.com/t/kagJIldpJfMQ and I don't know how to tell it to run the insert query anyway.
Reason for this: If there are new records added to a parent table, I often want to make sure that a child table has a record for every new record in the parent before opening the child table. For example, I have a parent table that is a set of Cost Codes. Then I have a child table that is a Job Budget table made up of records that have a Job Code and a Cost Code with an index that prevents a duplicate record with same Job Code and Cost Code. Before opening a job budget, I want to make sure any new Cost Codes have been added to that budget, so in Access I run an insert query that tries to append all Cost Codes to the child budget table with the appropriate Job Code. I expect that it will produce the duplicate index error, but am able to get around it in Access, and insert only records that do not violate the unique index (ie, the new cost codes). I do not want to insert records to the budget table for all jobs at the time a new cost code is set up because some jobs may not have budgets yet, and I don't want to create budget records for those jobs yet (since creating a new job budget is done based on additional calculated criteria gathered from the Jobs table).
Well, this is probably too complex or confusing, but just thought I'd throw this out there in case there are any Access to Alpha gurus that have dealt with this before. Thanks for any advice.
Comment