ADO Index property and Seek method 
Author Message
 ADO Index property and Seek method

The following is a fragment of VB6 test code where I have been trying
to use the index and the Seek method of an ADO recordset.

So far I have been unable to get it to work.  It always says it is not
implemented in the present interface.

Is it merely not implemented, as it says, or am I doing somethimng
wrong.  According to the MSDN site it aught to work.

If anyone can help I would be most grateful

Geoff

   Dim Cnn  As New Connection
   Dim sCnn As String
   Dim Rs  As New adodb.Recordset

   Dim strSQLEmployees As String

   Cnn.Provider = "Microsoft.Jet.OLEDB.4.0"

   sdb = "C:\Temp\TestData.Mdb"

   sCnn = "Data Source=" & sdb & ";" & _
           "Jet OLEDB:Database Password=letmein"

   Cnn.CursorLocation = adUseServer
   Cnn.Mode = adModeReadWrite
   Cnn.Open sCnn

   Rs.CursorLocation = adUseServer
   strSQLEmployees = "test table"
   Rs.Open strSQLEmployees, Cnn, adOpenKeyset, adLockReadOnly, _        
        adCmdTableDirect

   If Rs.Supports(adIndex) Then
      Rs.Index = "long auto"
      Rs.Seek 2
   End If



Tue, 06 Dec 2005 11:29:04 GMT  
 ADO Index property and Seek method
Quote:

> The following is a fragment of VB6 test code where I have been trying
> to use the index and the Seek method of an ADO recordset.

> So far I have been unable to get it to work.  It always says it is not
> implemented in the present interface.

> Is it merely not implemented, as it says, or am I doing somethimng
> wrong.  According to the MSDN site it aught to work.

> If anyone can help I would be most grateful

> Geoff

>    Dim Cnn  As New Connection
>    Dim sCnn As String
>    Dim Rs  As New adodb.Recordset

>    Dim strSQLEmployees As String

>    Cnn.Provider = "Microsoft.Jet.OLEDB.4.0"

>    sdb = "C:\Temp\TestData.Mdb"

>    sCnn = "Data Source=" & sdb & ";" & _
>            "Jet OLEDB:Database Password=letmein"

>    Cnn.CursorLocation = adUseServer
>    Cnn.Mode = adModeReadWrite
>    Cnn.Open sCnn

>    Rs.CursorLocation = adUseServer
>    strSQLEmployees = "test table"
>    Rs.Open strSQLEmployees, Cnn, adOpenKeyset, adLockReadOnly, _  
>    adCmdTableDirect

>    If Rs.Supports(adIndex) Then
>       Rs.Index = "long auto"
>       Rs.Seek 2
>    End If

Hi Geoffrey,

I tried your code and it worked fine for me so there is no absolute
technical reason it won't work, it must be a detail of your setup.

I tested it with VB6 SP5, ADO 2.6 and Access 2000 SP1 on Windows 2000
SP3.



Tue, 06 Dec 2005 17:13:42 GMT  
 ADO Index property and Seek method
I got your code to work fine, with no problems.
Which version of MDAC / ADO are you using?

Adelle.
http://www.akemi.com.au/vb/



Tue, 06 Dec 2005 17:27:42 GMT  
 ADO Index property and Seek method
Thank you

You proved to me that it should work and I figured it from there.

It depends on the version of the database, and not just the engine
opening it.

I converted the database to that used by Office XP and it works.

Geoff



Wed, 07 Dec 2005 02:44:20 GMT  
 ADO Index property and Seek method
Thank you

You proved to me that it should work and I figured it from there.

It depends on the version of the database, and not just the engine
opening it.

I converted the database to that used by Office XP and it works.

Geoff



Wed, 07 Dec 2005 12:49:32 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Index Property/SEEK method Problem with ADO

2. Index Property / Seek Method In Recordset

3. Problems with the methods Index and Seek

4. Seek, Index on ADO Recordset

5. Seek - Index. ADO 2.1

6. Seek - Index. ADO 2.1

7. Index and Seek in ADO

8. ADO USING SEEK AND INDEXES

9. SEEK and INDEX whith ADO ???

10. ADO Seek, Index

11. Seek method on ADO data recordset?

12. ADO and Seek Method

 

 
Powered by phpBB® Forum Software