14609.html

来自「VB技巧问答10000例,是一个教程」· HTML 代码 · 共 27 行

HTML
27
字号
<html>
  <head>
    <title>Cursor 指到 Server 了</title>
  </head>
  <body bgcolor="#FFFFFF" vlink="#808080">
    <center>
      <h1>Cursor 指到 Server 了</h1>
    </center>
<hr size=7 width=75%>

<hr size=7 width=75%><p>
Posted by <a href="mailto:sephiroth@optimasoft.com.tw">Sephiroth</a> on June 25, 1999 at 09:36:11:<p>
In Reply to: <a href="14587.html">请问如何读取总笔数?</a> posted by Joef on June 24, 1999 at 17:17:17:<p>
: 我是用程式方式去open database<br>: Dim cnPersonal As Connection<br>: Dim rsDepartment As Recordset<br>: Dim c As Integer<br>: Set cnPersonal = New Connection<br>: Set rsDepartment = New Recordset<p>: With cnPersonal<br>:     .Provider = "Microsoft.Jet.OLEDB.3.51"<br>:     .ConnectionString = "Data Source = d:\work\personal\personal.mdb;"<br>:     .Open<br>: End With<p>: With HFGDepartment<br>:     rsDepartment.Open "department", cnPersonal,adOpenDynamic<br>:     adLockReadOnly<br>:             .<br>:             .<br>:             .<br>: end with<br>: 我用过rsDepartment.Recordcount去读取department表格的总笔数,但是不行,<br>: 不知我方法错误,可否告之如何读取谢谢<p><br>用以上的方法开启会将 Cursor指到 Server, 结果 RecordCount = -1<br>可以在 rsDepartment.Open 之前设定 .CursorLocation = adUseClient<br>如果想更了解 Cursor,可以参考 cww 的网站
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 14609-->
<!--top: 14612--><li><a href="14612.html">Re: Cursor 指到 Server 了</a> <b>Joef</b> <i>11:21:30 6/25/99</i>
(<!--responses: 14612-->0)
<ul><!--insert: 14612-->
</ul><!--end: 14612-->
</ul><!--end: 14609-->
<br><hr size=7 width=75%><p>

</body></html>

⌨️ 快捷键说明

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