If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Index Name(s)
I am using Access 2003
Is there a way to use SQL to get the Index Names on a table? I can get the data if I go to Tools-Analyze-Documenter, select the "Tables" tab, select the table I want and then click OK. A report is displayed in a window. I am using the data in the "Table Indexes" section Can I use SQL to get this information, if I know the table name? Thanks |
#2
|
|||
|
|||
Index Name(s)
You can get at the indexes and their properties through DAO.
The core idea (aircode) is: Dim db As DAO.Database Dim tdf As DAO.Tabledef Dim ind As DAO.Index Set db = CurrentDb For Each tdf in db.TableDefs For each ind in tdf.Indexes Debug.Print ind.Name next Next You probably want to skip the tables where the name starts with "~", or (tdf.Attributes And dbSystemObject) 0 -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. wrote in message ... I am using Access 2003 Is there a way to use SQL to get the Index Names on a table? I can get the data if I go to Tools-Analyze-Documenter, select the "Tables" tab, select the table I want and then click OK. A report is displayed in a window. I am using the data in the "Table Indexes" section Can I use SQL to get this information, if I know the table name? Thanks |
Thread Tools | |
Display Modes | |
|
|