Connecting Tech Pros Worldwide Forums | Help | Site Map

How to Update ignoring validation rule

Vladi
Guest
 
Posts: n/a
#1: Nov 13 '05
Experience is highly requested.

I can't find solution for the following problem:
I am making VBA code for moving/modifying data from "old" tables into
"new" ones. In fact, this is part of the upgrade module for a data entry
product. In the existing tables at customers' site there could be some
values in some fields, which violate validation rules. I have to copy
them as they are, in the new tables, in the fields having the same
validation rule.
I can't do this, at line with update - the error 3316 is coming.

--
Vlad

polite person
Guest
 
Posts: n/a
#2: Nov 13 '05

re: How to Update ignoring validation rule


On Tue, 06 Sep 2005 17:57:18 +0300, Vladi <vladislav.moltchanov@ktl.fi> wrote:
[color=blue]
>Experience is highly requested.
>
>I can't find solution for the following problem:
>I am making VBA code for moving/modifying data from "old" tables into
>"new" ones. In fact, this is part of the upgrade module for a data entry
> product. In the existing tables at customers' site there could be some
>values in some fields, which violate validation rules. I have to copy
>them as they are, in the new tables, in the fields having the same
>validation rule.
>I can't do this, at line with update - the error 3316 is coming.[/color]
Hi
I assume this is table-level validation.
You will have temporarily change the ValidationRule property for the tabledef
or field object while doing the importing (this is possible provided it is a non-
attached JET table) and then change it back again - I believe that if the latter
is done in codetthe database will not validate existing data though it
may tell the user this or ask whether it is required, you would need to test it.

It would be better if you could take some remedial action during the import to
correct errors or put them in some other table.

Vladi
Guest
 
Posts: n/a
#3: Nov 13 '05

re: How to Update ignoring validation rule


Thank you very much for your reply.
Situation is as simple. Since I don't know which field could be
corrupted. In that particular case I have learned, that one member of
local team has extended list of valid values, violating the golden rule
of centralized data collection - "no local modifications in data entry
routines". What I think about now is, how, if possible, to lock any
changes in fields ' attributes in the tables sent out to the
participating centres.

polite person wrote:[color=blue]
> On Tue, 06 Sep 2005 17:57:18 +0300, Vladi <vladislav.moltchanov@ktl.fi> wrote:
>
>[/color]
[color=blue]
>
> Hi
> I assume this is table-level validation.
> You will have temporarily change the ValidationRule property for the tabledef
> or field object while doing the importing (this is possible provided it is a non-
> attached JET table) and then change it back again - I believe that if the latter
> is done in codetthe database will not validate existing data though it
> may tell the user this or ask whether it is required, you would need to test it.
>
> It would be better if you could take some remedial action during the import to
> correct errors or put them in some other table.
>[/color]


--
Vlad
Closed Thread