如何获取 MS Access 数据类型列表?

发布于 2024-07-29 01:09:21 字数 95 浏览 1 评论 0原文

我试图在 C# 程序的组合框中列出 Microsoft Access 2000-2007 中的数据类型(取决于 MS Access 数据库版本)。 我怎样才能实现这样的目标?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

北城孤痞 2024-08-05 01:09:21

我认为不可能在运行时询问引擎来枚举它支持的数据类型。 例如,DAO 不会显示某些 Jet 4.0 数据类型,例如 NCHARBINARY; ADO将揭示Access数据库引擎从未支持的数据类型; 只有 ACEDAO 会显示多值类型。

我认为您需要提前了解每个版本的引擎支持的数据类型,然后在运行时选择适当的集。

Jet 4.0 数据类型(Access2000 到 2003 包括在内)和各种同义词可以在 这里(还应该给出一些有关 Jet 4.0 新增类型的提示,以防万一您需要支持早期版本的引擎)。

ACE(Access2007)添加了附件类型; 还有多值(“复杂”)类型,以支持 SharePoint 列表:我认为您需要自己决定多值类型是不同的类型还是仅仅是现有类型的变体。 Access2007 帮助中有一些详细信息。

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.

探春 2024-08-05 01:09:21

Microsoft.Office.Interop.Access.Dao.DataTypeEnum

当然,您需要添加引用,我绝对讨厌添加对 Office 的引用,因为您会与 Office 版本绑定,而且我讨厌每次升级时更新代码。

Microsoft.Office.Interop.Access.Dao.DataTypeEnum

Of course, you'll need to add a reference, and I absolutely hate adding reference to Office because you get tied to a version of Office,and I hate updating code every time we upgrade.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文