试一试如下代码:
Try
 ...
 except
  on E : Exception do
    MessageBox(0, PChar('Database error = ' + E.Message), 'Error', MB_OK+MBICONSTOP);
  end;