Board index » delphi » Detecting key violation in cached update modes?

Detecting key violation in cached update modes?

Hello!

Is there anyway to detect key violations before calling ApplyUpdates?  I want
the user to interactively correct key violation  errors.

--
---
frle...@bigfoot.com

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

 

Re:Detecting key violation in cached update modes?


I suspect you would have to actually search for the Key value outside of
your transaction.

Brian

frle...@bigfoot.com wrote in article <6tkomo$p4...@nnrp1.dejanews.com>...

Quote
> Hello!

> Is there anyway to detect key violations before calling ApplyUpdates?  I
want
> the user to interactively correct key violation  errors.

> --
> ---
> frle...@bigfoot.com

> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Re:Detecting key violation in cached update modes?


In article <6tkomo$p4...@nnrp1.dejanews.com>,

Quote
  frle...@bigfoot.com wrote:
> Hello!

> Is there anyway to detect key violations before calling ApplyUpdates?  I want
> the user to interactively correct key violation  errors.

> --
> ---
> frle...@bigfoot.com

> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Put a try .. except around the ApplyUpdates, if a constraint is violated, an
EDBEngineError will be raised, you can check the native error code to ensure
that the exception was raised by a key violation, and examine the error
message for the column involved.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Other Threads