Creating an index with ADOX
-
I'm having some trouble creating an index with ADOX (against MSJet as the provider). For the life of me, I can't figure out how to make the index *unique*. Sure, there is a pIndex->PutUnique() function on the Index object, but it doesn't seem to work, since the resulting database still lists the field as "duplicates OK" when I open it in Access. I've also tried 'pIndex->Properties("Unique")->PutValue(true)', but that only results in an exception being thrown (with some unhelpful error message). But PutValue(false) doesn't result in an error. Am I missing some prerequisites for a unique index? If I change the index in Access to "no duplicates" and reopen the database, both the pIndex->GetUnique() and Properties("Unique")->GetValue() return true. Any help is much appreciated.