May be you can try exception type warning at place or error. I never tried but seems 
to be logical. Hope it works for you.
 
Regards
 
Amit

Steeve Gilbert <[EMAIL PROTECTED]> wrote:

>From what I've read so far, the only way to catch sql exception with the try/catch is 
>to use class Statement and ODBCConnection to execute the query.

Steeve... 


-----Message d'origine-----
De : RHODPR [mailto:[EMAIL PROTECTED] 
Envoy� : 27 octobre 2004 10:28
� : [EMAIL PROTECTED]
Objet : Re: RE : [development-axapta] error catching when inserting in SQLServer




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 Links











Yahoo! Groups SponsorADVERTISEMENT


---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
  
   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Non-text portions of this message have been removed]






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/development-axapta/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




Reply via email to