views:

51

answers:

2

Hi,

I have a Microsoft Access Database and I need to execute a statement :

**DROP INDEX Name ON Installations

However, Microsoft Access says that no such index name found. The column "Name" in the Installations table does have an index on it . I know this from the Access GUI . However, I can't use the ACCESS GUI to turn off the index ( I have to do the task by using the OleDbConnection class from a C# program - I'm writing a database upgrader ) .

Any ideas ? How do I get a list of of names of indices for a given table in Access ?

All the best, Seb

+1  A: 

Here's how I found it.

  1. Open the table design.
  2. Right click on the Title Bar
  3. Select Indexes

Index Name Example.png

So in my example above, I would use:

drop index primarykey on bar
CodeSlave
+1  A: 

VBScript suit?

Dim objEngine ''As DAO.DBEngine
Dim db ''As DAO.Database
Dim tdf ''As DAO.TableDef

strDAOversion = "DAO.DBEngine.36"
Set objEngine = WScript.CreateObject(strDAOversion)

Set db = objEngine.OpenDatabase("c:\Docs\db.mdb")
Set tdf = db.TableDefs("ATable")
For Each ndx In tdf.Indexes
    s = s & vbCrLf & ndx.Name
Next
MsgBox s
Remou