开发者

Access: Names of Indices

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 ca开发者_StackOverflow社区n'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


Here's how I found it.

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

Access: Names of Indices

So in my example above, I would use:

drop index primarykey on bar


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜