Default Field Values

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
swright
Posts: 28
Joined: Wed 23 Dec 2009 12:19

Default Field Values

Post by swright » Mon 22 Mar 2010 17:03

Hello,
Is it possible when adding a new record usin TMSTable or TMSQuery for fields to be populated with default values.

eg.

Table.Open;
Table.Insert
FieldDefault := Table.FieldByName('A Field With Default').AsInteger;

This would allow bound checkboxes etc to show default rather than empty null etc.

thanks

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 23 Mar 2010 07:13

To solve the problem set the TCustomMSDataSet.Options.DefaultValues property to True.

swright
Posts: 28
Joined: Wed 23 Dec 2009 12:19

Post by swright » Tue 23 Mar 2010 08:58

Many Thanks

Post Reply