Search code examples
c#ms-accesslistcomboboxoledb

How do you get a list of MS Access data types?


I am trying to list data types from Microsoft Access 2000-2007 (depending on the MS Access database version) in a combobox for a C# program. How can I achieve such a thing?


Solution

  • I don't think it is possible to interrogate the engine at run time to enumerate the data types it supports. For example, DAO will not reveal some of the Jet 4.0 data types such as NCHAR and BINARY; ADO will reveals data types that the Access database engine has never supported; only ACEDAO will reveal multivalued types.

    I think you need to know in advance the data types each version of the engine supports then select the appropriate set at run time.

    Jet 4.0 data types (Access2000 to 2003 inclusive) and the various synonyms can be found here (should also give some hints about which types are new to Jet 4.0, just in case you need to support earlier versions of the engine).

    ACE (Access2007) added an Attachment type; also multivalued ("complex") types in order to support SharePoint lists: I think you will need to decide for yourself whether multivalued types are distinct types or merely variations on existing types. There are some details in the Access2007 Help.