12738.html
来自「以电子书的形式收集了VB一些常见问题解决方法,可以很方便的查找自己需要解决的问题」· HTML 代码 · 共 23 行
HTML
23 行
<html>
<head>
<title>Re: 补充说明</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>Re: 补充说明</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by <a href="mailto:jwh@ms1.hinet.net">纪文和</a> on May 08, 1999 at 22:23:20:<p>
In Reply to: <a href="12728.html">Re: 如何得知资料库总比数</a> posted by 小呆 on May 08, 1999 at 14:24:16:<p>
: : 如何取得资料库总比数<p>: Dim WS As Workspace<br>: Dim db As Database<br>: Dim rs As Recordset<br>: Set WS = DBEngine.Workspaces(0)<br>: Set db = WS.OpenDatabase("h:\gb\PGB-id.mdb", False, False) '开启档案<br>: Set rs = db.OpenRecordset("gbookid") '选择资料表使用者资料<br>: Debug.Print rs.RecordCount '总笔数<br>: rs.Close '关毕<br>: db.Close '关毕<br>: WS.Close<p>Set rs = db.OpenRecordset("gbookid") '选择资料表使用者资料<br>这时, rs.RecordCount 是不会正确的 (可能只是1)<br>必须先 rs.movelast 再<br>Debug.Print rs.RecordCount '总笔数<p>以下是 Msdn Library 中对 Recordcount 的一段说明<br>Use the RecordCount property to find out how many records in a Recordset or TableDef object have been accessed. The RecordCount property ((doesn't)) indicate how many records are contained in a dynaset-, snapshot-, or forward-only-type Recordset object until all records have been accessed. Once the last record has been accessed, the RecordCount property indicates the total number of undeleted records in the Recordset or TableDef object. To force the last record to be accessed, use the ((MoveLast)) method on the Recordset object. You can also use an SQL Count function to determine the approximate number of records your query will return.<p><p><br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 12738-->
</ul><!--end: 12738-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?