ADO and Store Procedure

gbreed at cix.compulink.co.uk gbreed at cix.compulink.co.uk
Tue Mar 12 12:15:34 EST 2002


Joel Quinet wrote:

> There is a Unique Contsraint on that table.  If I try to insert an 
> existing
> value in that table with the following script,
> I receive no error ....
> I would like to receive an error and be able to deale with it.
> Moreover, My store procedure return 1 in case of problem.  How can I 
> rescue
> that ?
> How can I do that ?

Try returning a negative number, and you should get an exception 
triggered.  Otherwise, it's an ADO problem, and nothing in particular to 
do with Python.  Try microsoft.public.inetserver.asp.db

> rs, res = cmd.Execute()

You might find res has the right value, or you might have to initialize 
the recordset first.  cmd.Paramters.Refresh()?  I forget.  If you do 
something like cmd.Parameters("continent").Value = "Europe" that might do 
the trick as well, depending on what the parameter is called.  The return 
value might then be one of the parameters after you run the procedure.


                        Graham

           <http://www.microtonal.co.uk/>




More information about the Python-list mailing list