Constant errors with check constraint in MS Access using SQL

后端 未结 1 1908
小鲜肉
小鲜肉 2021-01-20 23:41

I\'m creating the table with this command:

CREATE TABLE Comp (
SerialNumber Number Primary Key Not Null,
Make Text(12) Not Null,
Model Text(24) Not Null,
Process         


        
相关标签:
1条回答
  • 2021-01-21 00:02

    You need to run against a connection and Comp is a reserved word.

    ss = "ALTER TABLE [Comp] ADD CONSTRAINT CheckSpeed CHECK (ProcessorSpeed > 0)"
    CurrentProject.Connection.Execute ss
    

    Info: Constraints

    Reserved words in Jet/Access pre 2007 and ACE/Access 2007-

    0 讨论(0)
提交回复
热议问题