<p>テーブル側で処理する方法</p>
<p class="code">
<span class="key">procedure</span> TForm1.Tbable1BeforeInsert(DataSet: TDataset);<br />
<span class="key">begin</span><br />
&nbsp; Abort;<br />
<span class="key">end</span>;</p>
<p>DBGrid で処理する方法</p>
<pre class="code">
<span class="key">procedure</span> TForm1.DBGrid1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
<span class="key">begin</span>
  <span class="key">with</span> DBGrid1.DataSource.DataSet <span class="key">do</span>
  <span class="key">begin</span>
    <span class="key">if</span> (Key = VK_DOWN) <span class="key">then</span>
    <span class="key">begin</span>
      DisableControls;
      Next;
      <span class="key">if</span> (EOF) <span class="key">then</span> Key := 0
      <span class="key">else</span> Prior;
      EnableControls;
    <span class="key">end</span>;
  <span class="key">end</span>;
<span class="key">end</span>;
</pre>