I created an MS Access table using the following code:
tbl := Database.CreateTableDef('English', 0, '', ''); try fld := tbl.CreateField('ID', dbLong, 0); fld.Attributes := dbAutoIncrField + dbFixedField; tbl.Fields.Append(fld); fld := tbl.CreateField('Content', dbText, 255); fld.Required := true; fld.AllowZeroLength := false; tbl.Fields.Append(fld); Database.TableDefs.Append(tbl); idx := tbl.CreateIndex('PrimaryKey'); idx.Fields.Append(idx.CreateField('ID', EmptyParam, EmptyParam)); idx.Primary := True; idx.Unique := true; tbl.Indexes.Append(idx); idx := tbl.CreateIndex('IX_Content'); idx.Fields.Append(idx.CreateField('Content', EmptyParam, EmptyParam)); idx.Primary := false; idx.Unique := true; tbl.Indexes.Append(idx); finally tbl := nil; end;
This works fine until I try to insert the two rows โField Typeโ and โField Typeโ into this table. I get a message that a unique index limits me to this. As you can see, they differ only in the case of the second word. Since I obviously did not make the register case insensitive (I would not even know how to do this), I do not quite understand why this is happening. Are indexes in text fields always case sensitive in MS Access? If not, what am I doing wrong?
source share