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.
OLE DB Provider 4.0 for Jet retrieves columns in alphabetical order rather than in column ordinal position order.
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.
For more information, see the following MSDN articles: