# ADO 的SEEK问题【试了好久都不成功】

Posted by jashon on September 20, 1999 at 09:35:02:

我是使用 SQL 7.0
利用ado 来开启资料库
但是一直试就是试不出来如何使用seek 及 index
请问是哪里出了问题呢
谢谢
以下是我的程式码

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim connstr As String
Dim sql As String
Set cn = New ADODB.Connection
connstr = "dsn=ele;UID=sa;PWD=;DataBase=hwbdat"
cn.ConnectionString = connstr
cn.Open
Set rs = New ADODB.Recordset
sql = "eletmast"
rs.CursorLocation = adUseServer
rs.Index = "PK_ELETMAST1"
rs.Open sql, cn, adOpenKeyset, adLockPessimistic, adCmdTable

'---------------

Follow Ups: