A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Index Name(s)



 
 
Thread Tools Display Modes
  #1  
Old July 21st, 2008, 05:56 AM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 1
Default 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  
Old July 21st, 2008, 06:10 AM posted to microsoft.public.access.queries
Allen Browne
external usenet poster
 
Posts: 11,706
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:48 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.