# Cursor 指到 Server 了

Posted by Sephiroth on June 25, 1999 at 09:36:11:

In Reply to: 请问如何读取总笔数? posted by Joef on June 24, 1999 at 17:17:17:

: 我是用程式方式去open database
: Dim cnPersonal As Connection
: Dim rsDepartment As Recordset
: Dim c As Integer
: Set cnPersonal = New Connection
: Set rsDepartment = New Recordset

: With cnPersonal
: .Provider = "Microsoft.Jet.OLEDB.3.51"
: .ConnectionString = "Data Source = d:\work\personal\personal.mdb;"
: .Open
: End With

: With HFGDepartment
: rsDepartment.Open "department", cnPersonal,adOpenDynamic
: adLockReadOnly
: .
: .
: .
: end with
: 我用过rsDepartment.Recordcount去读取department表格的总笔数,但是不行,
: 不知我方法错误,可否告之如何读取谢谢

用以上的方法开启会将 Cursor指到 Server, 结果 RecordCount = -1
可以在 rsDepartment.Open 之前设定 .CursorLocation = adUseClient
如果想更了解 Cursor,可以参考 cww 的网站

Follow Ups:

- Re: Cursor 指到 Server 了 Joef 11:21:30 6/25/99 (0)