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  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > DAO - Finding the Index\Primary Field?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-25-03, 13:12
matt_hall44 matt_hall44 is offline
Registered User
 
Join Date: Apr 2003
Location: United Kingdom, HERTFORDSHIRE
Posts: 1
Red face DAO - Finding the Index\Primary Field?

Hi there, im using VB6 with Data Access Objects connecting to an Access 2000 database.

I would like to find what the index\primary key is from the database using the DAO, but cannot find a method or property with the RecordSet object to do so.

Any help much appreciated
Reply With Quote
  #2 (permalink)  
Old 05-01-03, 02:42
playernovis playernovis is offline
Registered User
 
Join Date: Nov 2002
Location: San Francisco
Posts: 251
Re: DAO - Finding the Index\Primary Field?

in MS Access you can use

For i = 0 To CurrentDb.TableDefs('mytable').Indexes.Count - 1
Debug.Print CurrentDb.TableDefs('mytable').Indexes(i).Name & " : "; CurrentDb.TableDefs('mytable').Indexes(i).Primary
Next


if you use VB, you have to call DAO... it has the same property, there are few samples in DAO help...



jiri
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On