Hi,
Is there a way to disable the Required fields option with the AutoInc type fields ?
Create a table with an autoinc field (+ other test fields set to NOT NULL).
Build a delphi project with MyDAC 4.x.
Set the TMyquery.Options.Requiredfields to TRUE
Add a grid, navigator bar... Compile and run.
Insert a new record, fill all fields (except the Autoinc field).
Post : exception is raized : field 'My AutoInc field' must be filled
MyDAC 4.X : TMyquery.Options.Requiredfields and AutoInc type fields
-
- Posts: 451
- Joined: Wed 19 Jan 2005 09:59
Yes, just add to MyQuery.AfterOpen event handler something like this
Code: Select all
for i := 0 to DataSet.Fields.Count - 1 do
if DataSet.Fields[i].AutoGenerateValue = arAutoInc then
DataSet.Fields[i].Required := False;