0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ACCESSはマイクロソフトから冷遇されているのか?

Posted at

FieldAttributeEnum
魚拓[http://megalodon.jp/2017-0307-2058-57/https://msdn.microsoft.com:443/ja-jp/library/office/ff192118.aspx]
インデックスキーを決めるためにはAttributeを決める必要があるのですが、
このときのオートナンバー型の定数は
DAO Enum FieldAttributeEnum
のメンバーです。
しかたがないのでF2でオブジェクトブラウザーで見てみます。
Const dbAutoIncrField = 16 (&H10) 
Const dbDescending = 1
Const dbFixedField = 1
Const dbHyperlinkField = 32768 (&H8000)
Const dbSystemField = 8192 (&H2000)
Const dbUpdatableField = 32 (&H20)
Const dbVariableField = 2
dbAutoIncrField がオートナンバー型です。またハイパーリンクのフィールドを作るには
dbHyperlinkField
を使います。
With Tbl
Set fld = .CreateField("ID", dbLong)
fld.Attributes = dbAutoIncrField
.Fields.Append Object:=fld
End With
こんな感じです。

 しかし、このメンバー、なんと定数では同じなものがあるわけです
 しかも解説がないのです。
 この解説を出すには定数で検索するとよいようです。
Field.Attributes プロパティ (DAO)

定数
dbAutoIncrField
新しいレコードのフィールド値は、一意の長整数型の値に自動的に増分され、変更はできません (Microsoft Access ワークスペースでは、Microsoft Office Access データベース エンジン データベース テーブルでのみサポート)。<オートナンバー型の記述なし・・・これでは検索できない

dbDescending
フィールドを降順 (Z ~ A、100 ~ 0、ん~あ) で並べ替えるオプションで、これは、Index オブジェクトの Fields コレクションの Field オブジェクトのみに適用されます。この定数を省略すると、フィールドは昇順 (A ~ Z、0 ~ 100、あ~ん) で並べ替えられます。これは、Index フィールドおよび TableDef フィールドの既定値です (Microsoft Access ワークスペースのみ)。

dbFixedField
フィールド サイズは固定です (数値フィールドの既定)。
dbHyperlinkField
フィールドにはハイパーリンク情報が含まれます (メモ型フィールドのみ)。

dbSystemField
レプリカのレプリケーション情報が保存される、削除できないタイプのフィールドです (Microsoft Access ワークスペースのみ)。

dbUpdatableField
フィールド値を変更できます。

dbVariableField
フィールド サイズは可変です (テキスト フィールドのみ)。

でもこちらには値はない。

こんな重要な変数で不完全な記述しかない。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?