>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