PRB: Columns Are Sorted Alphabetically When You Use ADOX to Retrieve Columns of Access Table (299484)
The information in this article applies to:
- Microsoft Data Access Components 2.0
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.1 (GA)
- Microsoft Data Access Components 2.1 SP1
- Microsoft Data Access Components 2.1 SP2
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.5 SP1
- Microsoft Data Access Components 2.6
This article was previously published under Q299484 SYMPTOMS
If you use the ADOX Catalogs collection and the Microsoft OLE DB Provider for Jet to retrieve the columns of a Microsoft Access table, the columns are sorted alphabetically.
CAUSE
OLE DB Provider 4.0 for Jet retrieves columns in alphabetical order rather than in column ordinal position order.
RESOLUTION
To work around this problem, use ODBC Driver for Microsoft Access in conjunction with OLE DB Provider for ODBC. Other OLE DB Providers, such as the OLE DB Provider for SQL Server, do not pose this problem.
If you must use OLE DB Provider for Jet, use the OpenSchema method of the ADODB Connection object, and sort the resultant recordset on the ORDINAL_POSITION field.
REFERENCES
For more information, see the following MSDN articles:
Modification Type: | Major | Last Reviewed: | 12/3/2003 |
---|
Keywords: | kbJET kbprb KB299484 |
---|
|