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

error working with index collection

Status
Not open for further replies.

villan60

Technical User
Jul 5, 2001
23
ZA
Hi

could someone tell me why the following code gives me the error "object does not support this funtion"

Set td = dbs.TableDefs("St12InvTemp")
For Each Idx In td.Indexes
td.Indexes.Delete Idx
Next Idx

I am trying to delete all the indexes from a table (obviously). Maybe at the same time you can tell me why access is creating indexes on fields when I do an import with a spec and ask for no indexes.

???

thanks
dax
 
Hi, Dax!
You forgot add Name
td.Indexes.Delete idx.Name

Aivars
 
Thank you, you were absolutely correct.

Could you tell me now, why it does not delete all the indexes? After running that code I drop all the columns from the table and it gives me an error bcos there is still an index on one of the columns.

I also am bamboozled by the fact that it creates indexes for no good reason when I import this text file.

Thanks
dax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top