|
楼主 |
发表于 2019-7-29 13:23
|
显示全部楼层
- **************************************************************************************************************************************************ACCESS创建数据表
- '=================================================================================================================================================VBA
- StrSQL = "CREATE TABLE ACCESS测试表 (" '//数据表名 后面跟[(] 和最后[)]成对
- StrSQL = StrSQL & "[自动编号] COUNTER(1, 1) CONSTRAINT PK_TVIPLevel26 PRIMARY KEY" '//自动编号,从1开始,步长为1
- StrSQL = StrSQL & ",[文本255] VARCHAR NOT NULL" '//前后无空格,中间以空格分开,结尾是[,]
- StrSQL = StrSQL & ",[文本20] VARCHAR(20) NOT NULL"
- StrSQL = StrSQL & ",[日期时间] DATETIME"
- StrSQL = StrSQL & ",[数字1] BYTE"
- StrSQL = StrSQL & ",[数字2] SMALLINT DEFAULT 0 "
- StrSQL = StrSQL & ",[数字4] INTEGER DEFAULT 0 "
- StrSQL = StrSQL & ",[货币] CURRENCY"
- StrSQL = StrSQL & ",[小数] NUMERIC DEFAULT 0 "
- StrSQL = StrSQL & ",[单精度] REAL"
- StrSQL = StrSQL & ",[双精度] FLOAT DEFAULT 0 NOT NULL"
- StrSQL = StrSQL & ",[备注] MEMO"
- StrSQL = StrSQL & ",[布尔] BIT"
- StrSQL = StrSQL & ",[OLE对象] IMAGE)" '//最后一个,没有逗号 [,],结尾是[)]
复制代码 |
|