I use UCanAccess (4.0.2) to create a new file with a single table like this:
// Create a database + connect
DatabaseBuilder.create(FileFormat.V2010, new File(path));
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
conn = DriverManager.getConnection("jdbc:ucanaccess://" + path + ";singleconnection=true" ,"", "");
// Create table
String sql = "CREATE TABLE Test (id AUTOINCREMENT PRIMARY KEY, value CHAR(1) NOT NULL)";
conn.createStatement().executeUpdate(sql);
The code works but the resulting table seems to be incomplete/flawed. Trying to copy it in Access results in an error:
'' is not a valid name...
Doesn't seem to be a big problem as saving the table from the design view solves it.
Any idea why that happens and how to avoid it?