?? mdmscshapecommandsingeneral.htm
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML dir=ltr>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=gb2312"><title>常規(guī) Shape 命令</title>
<style>@import url(msdn_ie4.css);</style>
</HEAD>
<BODY>
<h2><a name="mdmscshapecommandsingeneral"></a>常規(guī) Shape 命令</h2>
<p><a href="dir.htm">目錄</a></p>
<p>
“數(shù)據(jù)構(gòu)形”定義了成形 <b>Recordset</b> 的列、由列代表的條目之間的關(guān)系以及數(shù)據(jù)充填到 <b>Recordset</b> 的方式。</p>
<p>
成形的 <b>Recordset</b> 可以由如下類型的列組成:</p>
<table border=1 cellpadding=5 cols=2 frame=below rules=rows>
<tr valign=top>
<td class=label width=23%><b>列類型</b></td>
<td class=label width=77%><b>說明</b></td>
</tr>
<tr valign=top>
<td width=23%>數(shù)據(jù)</td>
<td width=77%>由對數(shù)據(jù)提供者、表或以前成形 <b>Recordset</b> 使用查詢命令所返回的 <b>Recordset</b> 的字段。</td>
</tr>
<tr valign=top>
<td width=23%>子集</td>
<td width=77%>對另一個 <b>Recordset </b>的引用,稱為“子集”。子集列使定義“父-子”關(guān)系成為可能,在這種關(guān)系中“父”是包含子集列的 <b>Recordset</b>,“子”是由子集代表的 <b>Recordset</b>。</td>
</tr>
<tr valign=top>
<td width=23%>合計</td>
<td width=77%>列的值通過對所有行執(zhí)行“合計函數(shù)”獲得,或者是子 <b>Recordset</b> 的所有行的列。(請參閱下表中的合計函數(shù)。)</td>
</tr>
<tr valign=top>
<td width=23%>計算表達式</td>
<td width=77%>列的值通過對在 <b>Recordset</b> 的相同行中的列進行 Visual Basic for Applications 表達式的計算而獲得。表達式是 CALC 函數(shù)的參數(shù)。(請參閱下表中的計算表達式。)</td>
</tr>
<tr valign=top>
<td width=23%>新建</td>
<td width=77%>空的、虛構(gòu)的字段,可在隨后充填數(shù)據(jù)。列使用 NEW 關(guān)鍵字定義。(請參閱下表中的 NEW 關(guān)鍵字。)</td>
</tr>
</table><br>
<p>
Shape 命令可以包含子句,指定針對基本數(shù)據(jù)提供者并將返回 <b>Recordset</b> 對象的查詢命令。查詢的語法取決于對基本數(shù)據(jù)提供者的要求。雖然 ADO 并不要求使用任何指定的查詢語言,但通常是使用結(jié)構(gòu)化查詢語言 (SQL)。</p>
<p>
您可以使用 SQL <b>JOIN</b> 子句關(guān)聯(lián)兩個表,但是,分級 <b>Recordset</b> 可以更有效地表達信息。由 <b>JOIN</b> 創(chuàng)建的 <b>Recordset</b> 的每行會多余地重復一個表中的信息。分級 <b>Recordset</b> 的多個子 <b>Recordset </b>對象中,每個對象僅有一個父 <b>Recordset</b>。</p>
<p>
Shape 命令可以僅由 <b>Recordset</b> 對象發(fā)出。</p>
<p>
Shape 命令可以嵌套,即父命令或子命令本身可以是另一個 Shape 命令。</p>
<p>
有關(guān)定位分級 <b>Recordset </b>的詳細信息,請參閱<a href="mdmscaccessingrowsinhierarchicalrecordset.htm">訪問分級 Recordset 中的行</a>。</p>
<p>
有關(guān)語法正確的 Shape 命令的詳細信息,請參閱<a href="mdmscformalshapegrammar.htm">形狀語法格式</a>。</p>
<p class=label>
<b>合計函數(shù)、CALC 函數(shù)和 NEW 關(guān)鍵字</b></p>
<p>
數(shù)據(jù)構(gòu)形支持如下函數(shù)。<i>chapter-alias </i>是指定給包含了將被操作列的子集名稱。</p>
<p>
chapter-alias(子集-別名)可以是完整的,由指向包含 <i>column-name </i>的子集的每個子集列名稱組成,全部用句號分隔。例如,如果父子集 chap1 包含擁有數(shù)量列 amt 的子子集,則完整名即是 chap1.chap2.amt。</p>
<table border=1 cellpadding=5 cols=2 frame=below rules=rows>
<tr valign=top>
<td class=label width=50%><b>合計函數(shù)</b></td>
<td class=label width=50%><b>說明</b></td>
</tr>
<tr valign=top>
<td width=50%>SUM(<i>chapter-alias</i>.<i>column-name</i>)</td>
<td width=50%>計算指定列中所有值的和。</td>
</tr>
<tr valign=top>
<td width=50%>AVG(<i>chapter-alias</i>.<i>column-name</i>)</td>
<td width=50%>計算指定列中所有值的平均值。</td>
</tr>
<tr valign=top>
<td width=50%>MAX(<i>chapter-alias</i>.<i>column-name</i>)</td>
<td width=50%>計算指定列中的最大值。</td>
</tr>
<tr valign=top>
<td width=50%>MIN(<i>chapter-alias</i>.<i>column-name</i>)</td>
<td width=50%>計算指定列中的最小值。</td>
</tr>
<tr valign=top>
<td width=50%>COUNT(<i>chapter-alias</i>[.<i>column-name</i>])</td>
<td width=50%>計算指定別名或列中行的數(shù)量。</td>
</tr>
<tr valign=top>
<td width=50%>STDEV(<i>chapter-alias</i>.<i>column-name</i>)</td>
<td width=50%>計算指定列中的標準偏差。</td>
</tr>
<tr valign=top>
<td width=50%>ANY(<i>chapter-alias</i>.<i>column-name</i>)</td>
<td width=50%>列的值(列的值在所有行均相同)。</td>
</tr>
</table><br>
<table border=1 cellpadding=5 cols=2 frame=below rules=rows>
<tr valign=top>
<td class=label width=50%><b>計算表達式</b></td>
<td class=label width=50%><b>說明</b></td>
</tr>
<tr valign=top>
<td width=50%>CALC(<i>expression</i>)</td>
<td width=50%>計算任意表達式,但僅針對包含 CALC 函數(shù)的 <b>Recordset</b> 行。可以是任何 Visual Basic for Applications (VBA) 函數(shù)或表達式。</td>
</tr>
</table><br>
<table border=1 cellpadding=5 cols=2 frame=below rules=rows>
<tr valign=top>
<td class=label width=50%><b>NEW 關(guān)鍵字</b></td>
<td class=label width=50%><b>說明</b></td>
</tr>
<tr valign=top>
<td width=50%>NEW (field type [(width | scale [,precision])]</td>
<td width=50%>將指定類型的空列添加到 <b>Recordset</b>。</td>
</tr>
</table><br>
<center> <A HREF="http://www.51windows.Net">www.51windows.Net</A></center>
<SCRIPT LANGUAGE="JavaScript" src="/log/sitelog2.asp"></SCRIPT>
<script src="script.js"></script></BODY>
</HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -