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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Indexes in Linked tables

Status
Not open for further replies.

Crookshanks

Technical User
May 18, 2004
296
NL
Good afternoon,

In my application I use linked tables. Now, I meet a problem (error = operation not supported with this type of object) when I want to search something in that tables using an indexed field, something like this:

rsInt = db.openRecordset("tbl_intermediars")
rsInt.index = "primary key"
rsint.seek "=", 1

Now it seems that that I can not use the indexes of a table when it is a linked table. Why does this happen, and who has a solution? Do I need to "loop" through all records with a do while-statement?

Kind regards,
 
The Index and Seek properties only exist for a table-type recordset. You can't open a table-type recordset on a linked table. You will have to convert to using a dynaset-type recordset, and trust Jet to select the best index.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
OK, thanks for your quick answer. But could you please tell me how to start this conversion to dynaset-type.
What should I change in my code.
 
Well, I have almost never used table-type recordsets so I'm not sure this covers it, but for the statements
rstInt.Index = "Primary Key"
rstInt.Seek "=", 1
you would substitute
rstInt.FindFirst "<primary key field name> = 1"

Hope that helps.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top