Search code examples
javams-accessjdbc-odbc

[Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition


I am accessing an Access database inside a java program, however I get an error when I execute the sql command:

static String SQLCreate = "CREATE TABLE CONTACT_INFO (" +
        "Contact_ID INTERGER NOT NULL PRIMARY KEY," +
        "First_Name VARCHAR(20) NOT NULL," +
        "MI CHAR(1)," +
        "Last_Name VARCHAR(20) NOT NULL," +
        "Street VARCHAR(50) NOT NULL," +
        "City VARCHAR(2) NOT NULL," +
        "ZIP VARCHAR(10) NOT NULL);";

I cant see anything wrong, maybe a new set of eyes will help. Thanks in advance.


Solution

  • You have a typo. Replace INTERGER with INTEGER and it should work.