Visual Basic中的.Index方法“无法找到方法或数据成员”

时间:2017-12-17 06:35:17

标签: vba

1 个答案:

答案 0 :(得分:0)

并非所有Recordset都支持索引搜索。你确定用正确的参数打开了Recordset吗?

Seek Method and Index Property Example (VB)开始关注此示例。确保使用相同的参数打开Recordset。

 rstEmployees.Open strSQLEmployees, strCnxn, adOpenKeyset, adLockReadOnly, adCmdTableDirect 

然后使用此代码段查看是否支持索引搜寻

' Does this provider support Seek and Index?  
If rs1.Supports(adIndex) And rs1.Supports(adSeek) Then  
    MsgBox "Success: Seek and Index are Supported"
Else
   MsgBox "Failure:  Seek and Index are not Supported"
End If