vba Access 2010 中 TableDef 字段类型整数的资源

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18854629/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 23:22:34  来源:igfitidea点击:

Resource for TableDef field type integers in Access 2010

vbams-accessaccess-vba

提问by whistler

I'm trying to find a resource to tie the field type integers I'm receiving from the following:

我试图找到一个资源来绑定我从以下接收到的字段类型整数:

    MsgBox CurrentDb.TableDefs("tblTemp").Fields("ID").Type

to their corresponding data types. Here's an example from Office Dev Center, http://msdn.microsoft.com/en-us/library/office/ff845405(v=office.14).aspx

到它们对应的数据类型。这是 Office Dev Center 中的一个示例,http://msdn.microsoft.com/en-us/library/office/ff845405(v=office.14).aspx

but this is the properties list for the 'Field' collection instead of 'Fields'. The integers I'm returning are coming from somewhere... Autonumber returns 4, DateTime 8, Text 10, Memo 12, it's working so I assume they're cataloged somewhere. Might be the result of another reference library I have active, only Office and Excel Objects outside of the norm for Access.

但这是“字段”集合而不是“字段”的属性列表。我返回的整数来自某个地方...... Autonumber 返回 4、DateTime 8、Text 10、Memo 12,它正在工作,所以我假设它们在某个地方被编目。可能是我使用的另一个参考库的结果,只有超出 Access 规范的 Office 和 Excel 对象。

Does anyone have any ideas on a resource I can utilize, or maybe an explanation if I'm misinterpreting these values?

有没有人对我可以利用的资源有任何想法,或者如果我误解了这些价值观,可能会做出解释?

回答by whistler

http://allenbrowne.com/func-06.html

http://allenbrowne.com/func-06.html

Found this almost immediately after submitting this question, while I had googled for over an hour prior its submission. Guess that's how it goes... It's for Access 2000-02, but seems to correspond to the values I'm receiving. Posting for future researchers.

在提交这个问题后几乎立即发现了这个,而我在提交之前已经搜索了一个多小时。猜猜这是怎么回事...它是用于 Access 2000-02,但似乎与我收到的值相对应。为未来的研究人员发帖。

回答by HansUp

The values returned by .Typeare members of the DAO.DataTypeEnum.

返回的值.Type是 的成员DAO.DataTypeEnum

? CurrentDb.TableDefs("tblFoo").Fields("id").Type
 4 
? dbLong
 4 

You can use the Object Browser from the VB Editor to look up the names and values of those enum members.

您可以使用 VB 编辑器中的对象浏览器来查找这些枚举成员的名称和值。

Object Browser displaying DAO.DataTypeEnum

显示 DAO.DataTypeEnum 的对象浏览器