Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What do i need to reference to be able to use Indexes?

Status
Not open for further replies.

gwar2k1

Programmer
Apr 17, 2003
387
GB
Im creating a table in Access 2000 and would like to be able to add a primary key to one of the columns. Im currently referencing:

MS ActiveX Data Objects 2.7 Library
MS ADO Ext. 2.7 for DLL and Security
MS DAO 2.5/3.51 Compatability Library

I dont really know how to setup a key, my assumptions, taken from other threads, is this:

Dim keyIndex As ADOX.index
keyIndex.Name = "TableIndex"
keyIndex.Unique = True
keyIndex.Columns.Append "EAN 8/13"
newTBL.Indexes.Append keyIndex

Would this be correct? Cause if it is i guess Im missing a reference as it doesnt work. Any one able to help?

TIA

~*Gwar3k1*~
"To the pressure, everything's just like: an illusion. I'll be losing you before long..."
 
=) Thanks. I was also missing the line: keyindex.primarykey = true as i wanted a primary key.
Thanks again =D

~*Gwar3k1*~
"To the pressure, everything's just like: an illusion. I'll be losing you before long..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top