Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exception Handling and Stored Procedures
Message
 
 
À
17/05/2004 14:15:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00904644
Message ID:
01000409
Vues:
15
Hi Brian,

I have the same situation. Here is my code:
TRY		   
			INSERT INTO updSchedules (cTrans_Employees_Queues_fk, cDiary_Code_fk, tScheduled_Time, iActive_At_Day_Start_Flag) ;
				VALUES ;
				(m.lcTrans_Employees_Queues_pk, .NULL., m.ttTime, 1)
			CATCH
			   llFailure = .T.			   
			ENDTRY
I have a trigger failure, but as a result I'm getting the same dialog as you. Is it a bug in VFP8? Was it fixed in VFP9?

Thanks in advance.

>In a database I have several stored procedures that raise errors that can be handled using a maintenance form class. These errors are caused by the user entering invalid data, and I want to display these errors in a different manner than other errors. My maintenance form parses the error, and checks for certain error codes, like a table rule failure. If it doesn't match the specified error codes, my regular error handling is invoked. This technique has worked well for me in my VFP 6 apps, but I am developing my latest application in 8.
>
> My problem is this: if I use a try block to wrap a tableupdate() or some other command that causes the buffer to be written to disk (firing a stored procedure), I get a "procedure canceled" dialog box when I raise an error. I tried using throw instead of error, but I still get the same dialog box. I know this has to do with the try block, because a few areas of my application do not use exception handling, and I do not get the dialog. I've tried looking in the help docs and online, but I can't find how to suppress this dialog. I don’t want to forgo using exception handling, because I’ve found it to be very useful in certain situations. I’ve tried setting talk off, but that doesn’t seem to help. I’m guessing I see this dialog because the procedure has been “canceled”, meanding that anything after the error command is not going to run. What I don’t understand is why this would happen for stored procedures vs. prg and method calls, because raising an error or throwing an exception
> effectively cancels that code as well, yet you don’t get the dialog.
>
>Any ideas?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform