command.CommandText = "CREATE TABLE MyTable (" +
"[Count] INT NOT NULL AUTO_INCREMENT PRIMARY KEY ," +
"[TimeAndDate] TIMESTAMP NOT NULL ," +
"[SerialNumber] VARCHAR( 14 ) NOT NULL ," +
"[Result] BOOL NOT NULL ," +
"UNIQUE ([TimeAndDate]))";
command.ExecuteNonQuery();
Code above flags syntax error exception, can you help me correct the query string? Thank you.
I’d suggest pasting the resulting query text into an Access query; it will tell you where the error is.
On my Access XP, pasting the resulting SQL gave a syntax error on AUTO_INCREMENT; it should be AUTOINCREMENT (see Access 2007 SQL data types) and be specified as a data type, not a constraint.
BOOL also gave an error => use BIT
Result which worked: