>TRY > ALTER TABLE myTable ADD PRIMARY KEY id_MyTable TAG id_MyTable >CATCH TO oException > DO CASE > CASE oException.errorno = 1705 &&access denied > lcErrorInfo = 'Somebody has the table open.' > CASE oException.errorno = 1884 &&uniqueness of index violated > lcErrorInfo = 'When trying to index the primary key, duplicate entries where found.' + CHR( 13 ) ; >+ 'Please fix the data.' > ENDCASE > > MESSAGEBOX( 'A problem was encountered while indexing table ' + UPPER( ALLTRIM( pcTableName ) ) + ':' + CHR( 13 ) ; >+ ALLTRIM( oException.message ) + CHR( 13 ) ; >+ lcErrorInfo, 48 ) >ENDTRY >>