ADOX to create Index in Access - does it?
- From: "Peter Boulton" <peter@data*no-spam*perceptions.co.uk>
- Date: Thu, 14 Jun 2007 09:43:49 +0100
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
.
- Prev by Date: Re: Array Compare
- Next by Date: ADO connection
- Previous by thread: Re: Array Compare
- Next by thread: ADO connection
- Index(es):
Relevant Pages
|
|