create table语句中的MS Access 2013语法错误

时间:2016-07-18 18:12:37

标签: sql access

这不会运行。有谁知道为什么?

Create Table Customer
(CustomerID Number(15,0)  AutoIncrement Not Null,
Name Varchar(40) Not Null,
Phone Varchar(20),
Email Varchar(40) Not Null,
Primary Key(CustomerID)
)

2 个答案:

答案 0 :(得分:0)

删除Number(15, 0)段:

Create Table Customer
(
    CustomerID AutoIncrement Not Null,
    Name Varchar(40) Not Null,
    Phone Varchar(20),
    Email Varchar(40) Not Null,
    Primary Key(CustomerID)
)

答案 1 :(得分:0)

也许喜欢这个?

   CurrentDb.Execute "Create Table Customer" & _
              "(CustomerID AUTOINCREMENT PRIMARY KEY NOT NULL ," & _
              "Name Varchar(40) Not Null," & _
              "Phone Varchar(20)," & _
              "Email Varchar(40) Not Null)"