Yes I can, I know that is an option.  But is there any way to catch
such an exception?  Maybe there will be other exceptions that are
thrown by SQL Server, I just want to know if it's possible to catch
them...

--- In [EMAIL PROTECTED], "Steeve Gilbert"
<[EMAIL PROTECTED]> wrote:
>
> Can't you just do a select statement to check if the record
already exists?
>
> Steeve...
>
>
> -----Message d'origine-----
> De�: RHODPR [mailto:[EMAIL PROTECTED]
> Envoy�: 27 octobre 2004 05:54
> ��: [EMAIL PROTECTED]
> Objet�: [development-axapta] error catching when inserting in
SQLServer
>
>
>
>
> Hi all,
> I want to insert a new record in the EmployeeTable in Axapta (SQL
> Server).  If there is already an employee in it with the same
> EmplId, it (SQL Server I guess) returns an error.  How can I catch
> this error?  The code below doesn't work : the error is directly
> shown on the screen, and is never catched... I already tried all
of
> the exception-types, yet none works...
>
> try {
>     employeeTable.InitValue();
>     employeeTable.Name = "Tom Hoebers";
>     employeeTable.EmplId = "THO";
>     employeeTable.insert();
> }
> catch (exception::Error) {
>     print "the error is never catched...";
>     pause;
> }
>
>
>
>
>
>
>
>
>

> Yahoo! Groups Links







Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to