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

📄 9.htm

📁 vb基础教程源文件 处学者必备
💻 HTM
📖 第 1 页 / 共 5 页
字号:
  </td>
 </tr>
</table>

<p>绑定控件、数据控件、数据库之间的关系: </p>

<p><strong>  绑定控件的属性 </strong>: </p>

<p>        <span lang=EN-US>DataSource ——通过一个有效的数据控件连接到一个数据库上。 </span></p>

<p>        <span lang=EN-US>DataField ——将数据库中的有效字段连接到绑定控件上。 </span></p>

<p>除了常规控件外,可以与<span lang=EN-US> Data 数据控件绑定的控件有: </span></p>

<table border=1 cellspacing=0 cellpadding=0 style='mso-cellspacing:0cm;
 border:solid windowtext .5pt;mso-padding-alt:0cm 0cm 0cm 0cm'>
 <tr>
  <td width=96 valign=top style='width:72.0pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong>控件名称 </strong></p>
  </td>
  <td width=282 valign=top style='width:211.5pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong>部件名称 </strong></p>
  </td>
  <td width=174 valign=top style='width:130.5pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong>常用属性 </strong></p>
  </td>
 </tr>
 <tr>
  <td width=96 valign=top style='width:72.0pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>MSFlexGrid </span></p>
  </td>
  <td width=282 valign=top style='width:211.5pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>Microsoft FlexGrid Control 6.0 ( OLE DB ) </span></p>
  </td>
  <td width=174 valign=top style='width:130.5pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>DataSourse </span></p>
  </td>
 </tr>
 <tr>
  <td width=96 valign=top style='width:72.0pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>DBCombo </span></p>
  </td>
  <td width=282 rowspan=2 valign=top style='width:211.5pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>Microsoft Data Bound List Controls 6.0 </span></p>
  </td>
  <td width=174 rowspan=2 valign=top style='width:130.5pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>DataField 、 DataSource 、 ListField 、 RowSource 、
  BoundColumn </span></p>
  </td>
 </tr>
 <tr>
  <td width=96 valign=top style='width:72.0pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>DBList </span></p>
  </td>
 </tr>
 <tr>
  <td width=96 style='width:72.0pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>DBGrid </span></p>
  </td>
  <td width=282 style='width:211.5pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>Microsoft Data Bound Grid Control 5.0 ( SP3 ) </span></p>
  </td>
  <td width=174 style='width:130.5pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>DataSourse </span></p>
  </td>
 </tr>
</table>

<p><strong><span lang=EN-US>3. 数据控件的事件 </span></strong></p>

<table border=1 cellspacing=0 cellpadding=0 style='mso-cellspacing:0cm;
 border:solid windowtext .5pt;mso-padding-alt:0cm 0cm 0cm 0cm'>
 <tr>
  <td width=79 valign=top style='width:59.25pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong>事件名称 </strong></p>
  </td>
  <td width=528 valign=top style='width:396.0pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong>触发时间 </strong></p>
  </td>
 </tr>
 <tr>
  <td width=79 style='width:59.25pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>Reposition </span></p>
  </td>
  <td width=528 valign=top style='width:396.0pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p>发生在一条记录成为当前记录后。只要将记录指针从一条记录移动到另一条记录就会触发。 </p>
  </td>
 </tr>
 <tr>
  <td width=79 style='width:59.25pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>Validate </span></p>
  </td>
  <td width=528 valign=top style='width:396.0pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p>在一条不同的记录成为当前记录之前,<span lang=EN-US> Update 方法之前(用 UpdateRecord 方法保存数据时除外);以及
  Delete 、 Unload 或 Close 操作之前会发生该事件。它检查被数据控件绑定的控件内的数据是否发生变化。 </span></p>
  <p>语法:<span lang=EN-US> Private Sub Data_Validate(Action As Integer, Save As
  Integer) …… End Sub </span></p>
  </td>
 </tr>
</table>

<p align=center style='text-align:center'><strong>   <span lang=EN-US>Validate 事迹的
Action 参数 </span></strong></p>

<table border=1 cellspacing=0 cellpadding=0 style='mso-cellspacing:0cm;
 border:solid windowtext .5pt;mso-padding-alt:0cm 0cm 0cm 0cm'>
 <tr>
  <td width=81 style='width:60.75pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>Action 值 </span></strong></p>
  </td>
  <td width=219 style='width:164.25pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong>描述 </strong></p>
  </td>
  <td width=112 style='width:84.0pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>Action 值 </span></strong></p>
  </td>
  <td width=176 style='width:132.0pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong>描述 </strong></p>
  </td>
 </tr>
 <tr>
  <td width=81 style='width:60.75pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>0 </span></strong></p>
  </td>
  <td width=219 style='width:164.25pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p>取消对数据控件的操作 </p>
  </td>
  <td width=112 style='width:84.0pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>6 </span></strong></p>
  </td>
  <td width=176 style='width:132.0pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>Update 操作 </span></p>
  </td>
 </tr>
 <tr>
  <td width=81 style='width:60.75pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>1 </span></strong></p>
  </td>
  <td width=219 style='width:164.25pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>MoveFirst 方法 </span></p>
  </td>
  <td width=112 style='width:84.0pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>7 </span></strong></p>
  </td>
  <td width=176 style='width:132.0pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>Delete 方法 </span></p>
  </td>
 </tr>
 <tr>
  <td width=81 style='width:60.75pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>2 </span></strong></p>
  </td>
  <td width=219 style='width:164.25pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>MovePrevious 方法 </span></p>
  </td>
  <td width=112 style='width:84.0pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>8 </span></strong></p>
  </td>
  <td width=176 style='width:132.0pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>Find 方法 </span></p>
  </td>
 </tr>
 <tr>
  <td width=81 style='width:60.75pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>3 </span></strong></p>
  </td>
  <td width=219 style='width:164.25pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>MoveNext 方法 </span></p>
  </td>
  <td width=112 style='width:84.0pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>9 </span></strong></p>
  </td>
  <td width=176 style='width:132.0pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p>设置<span lang=EN-US> Bookmark 属性 </span></p>
  </td>
 </tr>
 <tr>
  <td width=81 style='width:60.75pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>4 </span></strong></p>
  </td>
  <td width=219 style='width:164.25pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>MoveLast 方法。 </span></p>
  </td>
  <td width=112 style='width:84.0pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>10 </span></strong></p>
  </td>
  <td width=176 style='width:132.0pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>Close 的方法 </span></p>
  </td>
 </tr>
 <tr>
  <td width=81 style='width:60.75pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>5 </span></strong></p>
  </td>
  <td width=219 style='width:164.25pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>AddNew 方法 </span></p>
  </td>
  <td width=112 style='width:84.0pt;border:solid windowtext .75pt;padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong><span lang=EN-US>11 </span></strong></p>
  </td>
  <td width=176 style='width:132.0pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p>卸载窗体 </p>
  </td>
 </tr>
</table>

<p><strong><span lang=EN-US>4. 数据控件的常用方法 </span></strong></p>

<table border=1 cellspacing=0 cellpadding=0 style='mso-cellspacing:0cm;
 border:solid windowtext .5pt;mso-padding-alt:0cm 0cm 0cm 0cm'>
 <tr>
  <td width=103 valign=top style='width:77.25pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong>方法名称 </strong></p>
  </td>
  <td width=360 valign=top style='width:270.0pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong>作用 </strong></p>
  </td>
  <td width=151 valign=top style='width:113.25pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong>示例 </strong></p>
  </td>
 </tr>
 <tr>
  <td width=103 style='width:77.25pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>Refresh </span></p>
  </td>
  <td width=360 style='width:270.0pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p>激活数据控件,使各用户对数据库的操作有效。 </p>
  </td>
  <td width=151 style='width:113.25pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>Data1.Refresh </span></p>
  </td>
 </tr>
 <tr>
  <td width=103 style='width:77.25pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>UpdateControls </span></p>
  </td>
  <td width=360 style='width:270.0pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p>将数据从数据库中重新读到数据控件绑定的控件内,通过它可以终止用户对绑定控件内数据的修改。 </p>
  </td>
  <td width=151 style='width:113.25pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><strong>放弃修改 </strong>按钮代码: </p>
  <p><span lang=EN-US>Data1. UpdateControls </span></p>
  </td>
 </tr>
 <tr>
  <td width=103 style='width:77.25pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><span lang=EN-US>UpdateRecord </span></p>
  </td>
  <td width=360 style='width:270.0pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p>强制数据控件将绑定控件内的数据写入到数据库中,不再触发<span lang=EN-US> Validate 事件 </span></p>
  </td>
  <td width=151 style='width:113.25pt;border:solid windowtext .75pt;padding:
  0cm 0cm 0cm 0cm'>
  <p><strong>确认修改 </strong>按钮代码: </p>
  <p><span lang=EN-US>Data1. UpdateRecord </span></p>
  </td>
 </tr>
</table>

<p><strong><span lang=EN-US>5. 记录集的属性与方法 </span></strong></p>

<table border=1 cellspacing=0 cellpadding=0 style='mso-cellspacing:0cm;
 border:solid windowtext .5pt;mso-padding-alt:0cm 0cm 0cm 0cm'>
 <tr>
  <td width=151 colspan=2 style='width:113.25pt;border:solid windowtext .75pt;
  padding:0cm 0cm 0cm 0cm'>
  <p align=center style='text-align:center'><strong>名称 </strong></p>
  </td>

⌨️ 快捷键说明

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