Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Index property of ADO can't be used?

Status
Not open for further replies.

JunglesMcBeef

Programmer
Sep 18, 2003
266
G'day,

I have a project in Access 2000, and when i try and set the index property of the ADODB.recordset i get the following error msg '3251':

"Current provider does not support the necessary interface for Index functionality."

I have set up the index already within the table, so there should be no reason for it to return an error. I have changed the index in other similar projects and never seen this error msg before. Here is a little snippet of my code, breaking where the index statement is:

Set cnn = CurrentProject.Connection
strSQL = "SELECT * FROM WgtP2"

With rs
Set .ActiveConnection = cnn
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open strSQL

If Not .EOF And Not .BOF Then
.Index = "Customer ID"

Can anyone please help me with this?
 
Read up on the "Supports" property for recordsets.

Not all providers are able to use "Index" and "Seek" properties and methods. It is a limitation within the provider. It is not determined by your having created an index in Access. Some require that you use server-side cursors rather than client side and the type of recordset (i.e. KeySet, Static, Foreward Only) can affect whether or not a particular provider supports Index/Seek functionality.
 
Ok, I got around the problem by setting the index while the recordset was closed along with the other properties such as cursortype and locktype etc. Thanks for the help anyway.
 
Actually, i was wrong, i still have the same problem. What is a 'provider'? and if my provider doesnt support the property, how do i use a provider that does?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top