ADOX to create Index in Access - does it?



Hi,

I'm using Carlos Antollini's classes from CodeProject
(http://www.codeproject.com/database/caaadoxclass.asp) to create a table and
index fields, using C++/MFC/VS2005.

The relevant bit of the code, using his classes is:

// Add the table
cattie.AddTable(pxTable);

// Add the index
CADOXIndex pxInd;
pxInd.Create(strTable+"_Index");
for (count=0; count < 2; count++)
{
pxInd.AddField(arrDBFields[count], CADOXIndex::typeWChar);
}
pxInd.SetPrimarKey(FALSE);
pxTable.AddIndex(pxInd);

All the functions just wrap the ADOX stuff in C++ clothes, and stepping
through the code everything returns TRUE.

However:

(1) If I look at the table design view for the table in Access 2003 once the
code has run, the 'Indexed' property for the 2 fields is 'No'.

(2) HOWEVER, if I use the menu options 'Tools', 'Analyze', 'Documentor' in
Access and run it for my table it says:

Table Indexes
Name Number of
Fields

prophdatatest 2

Clustered: False

DistinctCount: 360

Foreign: False

IgnoreNulls: False

Name: prophdatatest

Primary: False

Required: True

Unique: False

Fields:

CustKey Ascending

ProdKey Ascending



Doesn't this mean it IS indexed?



Sorry, I'm a bit of a newbie on this stuff - I'd really appreciate some
advice on whether what I've done has created the index or not.



Incidentally, running the same code against SQL Server 2000 the table
definition view didn't have the fields indexed.



TIA!



Pete




.



Relevant Pages

  • Re: Dynamic structure of a table?!!
    ... And reply for Carlos: I think there is only one entity called "Form".This ... is an conceptual modeling(not design) so there is no *Entity* called filed. ... I have mentioned in original post. ... >plus Field Identificator with attributes heigth, width, X pos, Y pos, ...
    (comp.databases.oracle.server)
  • Re: Visual Studio 2005 is a memory hog!!
    ... >>> Best regards, ... >>> Carlos J. Quintero ... design and document much faster. ...
    (microsoft.public.vsnet.general)
  • Re: Run macro at startup
    ... Productivity add-ins for Visual Studio ... >> Carlos J. Quintero ... design and document much faster: ...
    (microsoft.public.vsnet.general)
  • Re: Windows XP Styles
    ... Carlos J. Quintero ... >> Best regards, ... >> Carlos J. Quintero ... design and document much faster. ...
    (microsoft.public.vsnet.ide)
  • Re: Auslessen Enter-Key
    ... Best regards, ... Carlos J. Quintero ... design and document much faster. ...
    (microsoft.public.dotnet.framework)