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

问题描述 投票:-4回答:1

when i want to log in, there will be a msg box stating "Method or data member not found" and when i click ok, it highlight the .Index I'm trying to connect the vb and the ms access database

嗨,请帮忙

vba
1个回答
0
投票

并非所有Recordsets都支持Index和Seek。你确定用适当的参数打开了Recordset吗?

按照Seek Method and Index Property Example (VB)的这个例子。确保使用相同的参数来打开Recordset。

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

然后使用此代码段查看是否支持Index和Seek:

' 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
© www.soinside.com 2019 - 2024. All rights reserved.