Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRY...CATCH fails with error 1884 - revised
Message
From
13/02/2004 11:43:10
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00877145
Message ID:
00877154
Views:
14
>This will hit the TRY, run the ALTER TABLE, then, in the scenario outlined above, display the 'Uniqueness of index....blah blah blah' standard VFP error 1884, the CATCH will never fire. Anyone know a way around this, or can tell me if I've got something wrong? Thanks,
>
>jfh

Hey John,
I tried the code above and the ALTER TABLE seems to just go strait to the ON ERROR command. So if you turn it off I now works for me.
TRY
   ON ERROR *
   ALTER TABLE myTable ADD PRIMARY KEY my_id TAG my_id
   ON ERROR
CATCH TO oException WHEN oException.ErrorNo = 1884
     MESSAGEBOX( 'KAPOW!  Go fix your data.' )
ENDTRY
Charles

"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform