How to create a decimal field in MsAccess using DAO?

五迷三道 提交于 2020-01-15 10:08:28

问题


I need to create a decimal field in MsAccess 2003 through DAO. How do I do that? Other fields I can create using following codesnippet, but not decimal.

How do I set type, precision and scale?

NOTE : a decimals datatype = 20, but setting a datatype to 20 results in invalid data type

Dim db As DAO.Database
Dim tbl As TableDef
Dim fld As Field

Set db = CurrentDb

tbl = database.CreateTableDef("Test")
fld = tbl.CreateField( ....   )

回答1:


You may find this useful: http://allenbrowne.com/ser-49.html#_ftn7

It states that decimal is not available in DAO and ADO should be used to create such fields.



来源:https://stackoverflow.com/questions/1630526/how-to-create-a-decimal-field-in-msaccess-using-dao

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!