⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deletingrecords.htm

📁 Absolute Database 5.12 src. Absolute Database lets you forget the Borland Database Engine (BDE). Th
💻 HTM
字号:
<html>
<head>
   <title>Deleting Records</title>
</head>

<!--#include virtual="/inc/header.php"-->


<table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="#FFFFFF">
  <tr>
    <td align="left">
      
<span style="font-family:Helvetica,Arial; font-size:12pt; color:#000000"><b>Deleting Records
<br>
</b></span>
    </td>
    <td align="right">
     <font face="Arial" size="2">
     <a href="editingrecords.htm">Previous</a>&nbsp;
     <a href="overview.htm">Top</a>&nbsp;
     <a href="sortingrecordswithindexes.htm">Next</a>
     </font>
    </td>
  </tr>
</table>
<br><br>



<span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
Use the <a href=tdataset_delete.htm>Delete </a>method to delete the current record in an active dataset.When the <i>Delete</i> method is called,
<br>

<br>
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td width="14"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><font face="Symbol" size="2" color="#000000">&#183;</font></span></td><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">The dataset receives a <i>BeforeDelete</i> event.
&nbsp;<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td width="14"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><font face="Symbol" size="2" color="#000000">&#183;</font></span></td><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">The dataset attempts to delete the current record.
&nbsp;<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td width="14"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><font face="Symbol" size="2" color="#000000">&#183;</font></span></td><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">The dataset returns to the <i>dsBrowse</i> state.
&nbsp;<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td width="14"><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"><font face="Symbol" size="2" color="#000000">&#183;</font></span></td><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">The dataset receives an <i>AfterDelete</i> event.
&nbsp;<br>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000"></span></td><td></td></tr></table><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
If want to prevent the deletion in the <i>BeforeDelete</i> event handler, you can call the global <i>Abort</i> procedure:
<br>

<br>
</span><span style="font-family:Courier New; font-size:8pt; color:#000000"><b>procedure</b>&nbsp;TForm1.TableBeforeDelete&nbsp;(Dataset:&nbsp;TDataset)<b>begin</b>
<br>
&nbsp;&nbsp;<b>if</b>&nbsp;MessageDlg(<span style="font-family:Courier New; font-size:8pt; color:#000080">'Delete&nbsp;This&nbsp;Record?'</span></span><span style="font-family:Courier New; font-size:8pt; color:#000000">,&nbsp;mtConfirmation,&nbsp;mbYesNoCancel,&nbsp;<span style="font-family:Courier New; font-size:8pt; color:#000080">0</span></span><span style="font-family:Courier New; font-size:8pt; color:#000000">)&nbsp;&lt;&gt;&nbsp;mrYes&nbsp;<b>then</b>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;Abort;
<br>
<b>end</b>;
<br>
</span><span style="font-family:Helvetica,Arial; font-size:10pt; color:#000000">
<br>
If <i>Delete</i> fails, it generates an <i>OnDeleteError</i> event. If the <i>OnDeleteError </i>event handler can't correct the problem, the dataset remains in <i>dsEdit</i> state. If <i>Delete</i> succeeds, the dataset reverts to the <i>dsBrowse</i> state and the record that followed the deleted record becomes the current record.
<br>
If you provide a navigator component on your forms, users can delete the current record by clicking the navigator's Delete button. In code, you must call <i>Delete</i> explicitly to remove the current record.
<br>
</span></span>

<!--#include virtual="/inc/footer.php"--> 
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -