所以我有下面的VB,它在默认工作区创建一个访问文件,创建一个表,在该表中创建一些字段......只需要知道将第一个数据类型/字段设置为自动编号的语法......GUID,计数器等不会像在 Access SQL 中那样工作
' error handling usually goes here
dim ws as workspace
dim dbExample as database
dim tblMain as TableDef
dim fldMain as Field
dim idxMain as Index
set ws = workspace(0)
set dbExample = ws.CreateDatabase('string file path')
set tblMain = dbExample.CreateTableDef("tblMain")
set fldMain = tblMain.CreateField("ID", 'right here I do not know what to substitute for dbInteger to get the autonumber type to work )
tblMain.Fields.Append fldMain
etc to create other fields and indexes
所以在这一行中: set fldMain = tblMain.CreateField("ID", dbInteger) 我需要用 VB 重新转换为自动编号属性的东西替换 dbInteger。我试过 GUID、Counter、Autonumber、AutoIncrement....不幸的是这些都不起作用
有人知道我在这里缺少的语法吗?
谢谢,贾斯汀