1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Index = new TADOXIndex(NULL);
OleVariant IndexName = "TOTO";
VARIANT_BOOL Prim = true;
Index->PrimaryKey = Prim;
Index->Unique = false;
Index->Name = IndexName;
for (int NbChp = 0; NbChp < Totalchp; NbChp++) {
int chp = 0;
int numchamp = -1;
while(chp < ChampsCount && numchamp==-1)
{
if(Champs[chp]->Nom == Champ[NbChp].Nom) numchamp=chp;
chp++;
}
ColName = Champ[NbChp].Nom;
Index->Columns->Append(ColName,Champs[numchamp]->TypeADOX,Champs[numchamp]->Taille);
}
IndexOle = (IDispatch*) Index->GetDefaultInterface();
ColumnsOle = (IDispatch*) Index->Columns;
TableToAdd->Indexes->Append(IndexOle ,ColumnsOle); |