I have the following code which throws an exception “COM Exception was unhandled” in the line I set the attribute:
var tbdefinition = dbase.TableDefs["MyDB"];
var field_auid = tbdefinition.Fields["myColumn"];
field_auid.Attributes = 4;
What am I doing wrong?
In Jet Databases, you cannot change the type of an existing field to Autonumber, if the table already contains records.
However, you can add a new field, which is an Autonumber field.