谁知道在这段建表代码里如果设置表的关键字?
ConDatabase.Execute "CREATE TABLE [Borrow] (" & _
"[THE_AnamnesisType] text (4)," & _
"[THE_AnamnesisID] text (7)," & _
"[THE_PatientName] text (8)," & _
"[THE_IDcard] text (18)," & _
"[THE_BorrowName] text (8)," & _
"[THE_BorrowIDcard] text (18)," & _
"[THE_BorrowFirm] text (80)," & _
"[THE_Introduce] text (80)," & _
"[THE_Use] text (80)," & _
"[THE_BorrowTime] datetime," & _
"[THE_ReturnTime] datetime" & _
")"
ConDatabase.Execute "CREATE TABLE [Borrow] (" & _
"[THE_AnamnesisType] text (4)," & _
"[THE_AnamnesisID] text (7)," & _
"[THE_PatientName] text (8)," & _
"[THE_IDcard] text (18)," & _
"[THE_BorrowName] text (8)," & _
"[THE_BorrowIDcard] text (18)," & _
"[THE_BorrowFirm] text (80)," & _
"[THE_Introduce] text (80)," & _
"[THE_Use] text (80)," & _
"[THE_BorrowTime] datetime," & _
"[THE_ReturnTime] datetime" & _
")"
"[ID] COUNTER NOT NULL," & _
"[BookTime] datetime NULL Default Now()," & _
"[ExaTime] datetime NULL Default Now() ," & _
"[State] Text(50) Default 预约,"
"[Memo] Text(255) ,PRIMARY KEY(ID))"
Conn.Execute SQL
其中"COUNTER"实现的是主键自增功能
"PRIMARY KEY(ID)"为设置 ID为主键