Groups | Blog | Home
all groups > dotnet interop > september 2007 >

dotnet interop : C# How to add index PrimaryKey with DAO


Requena Claudio
9/24/2007 3:38:01 AM
Hi,

I’m trying to add an Index PrimaryKey in one table with no success.
in the code below the Fields.Append don't exist and give me error.

DAO.TableDef OBJTable = DAO_DATABASE.TableDefs["Table"];
DAO.Index OBJIndex = OBJTable.CreateIndex("PrimaryKey");
OBJIndex.Fields.Append(OBJIndex.CreateField("fMonthCD"));

Any help will be appreciated, Thanks.

WillieD
10/18/2007 4:55:02 PM


[quoted text, click to view]

I had the same problem. Try casting it to DAO.IndexFields:

DAO.Field idxFld = OBJIndex.CreateField("fMonthCD");
((DAO.IndexFields) OBJIndex.Fields).Append(idxFld);

AddThis Social Bookmark Button