There must be an easier way.....

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
oz8hp
Posts: 151
Joined: Mon 18 Feb 2008 13:28
Location: Denmark
Contact:

There must be an easier way.....

Post by oz8hp » Wed 08 Jun 2011 07:08

For now I use
if not srcHams.DataSet.FieldByName('fldMail').IsNull then
Settings.RegMail := srcHams.DataSet.FieldByName('fldMail').Value
else
Settings.RegMail := '';
to check if a field has a value - this was a quick and dirty way of getting on with the job at the time. But there must be an easier way that I just haven't found in the manual :D

AndreyZ

Post by AndreyZ » Wed 08 Jun 2011 07:57

Hello,

You can use the following code:

Code: Select all

Settings.RegMail := srcHams.DataSet.FieldByName('fldMail').AsString;
If there is no value in the fldMail field, the AsString property will return an empty string.

oz8hp
Posts: 151
Joined: Mon 18 Feb 2008 13:28
Location: Denmark
Contact:

Post by oz8hp » Wed 08 Jun 2011 08:02

Thanks (as I sad - there must be an easier way :) )

Post Reply