Page 1 of 1

Fields with NULL values in MyDac

Posted: Thu 19 Apr 2007 09:15
by NoComprende
I know that MySQL treat NULL and empty strings ('') as being different. Does MyDac do the same? I noticed yesterday that

MyQuery->FieldByName("StringField")->IsNull returned false

yet the BCB IDE inspector displayed the value of

MyQuery->FieldByName("StringField")->AsString as NULL.

[The field in question has a MySQL default value of ''].

Posted: Thu 19 Apr 2007 14:51
by Antaeus
Both MySQL and MyDAC treat NULL values and empty strings as different values. If a field contains the NULL value, the IsNull method returns True, but AsString converts NULL values to empty strings.