Problems with Null in VarChar fields

Giganews Newsgroups
Subject:Problems with Null in VarChar fields
Posted by: Mikael Lenfors
Date:Mon, 29 Dec 2008

Hello!

I have an application running ADO against an Access database. All working perfectly in Delphi 2007 but when recompiling with Delphi 2009 I get the following eror:

When Updating fields of the type VarChar with a string of length zero is says something like this "Field xxx can not contain the value Null as the Required flag is set to True, enter a value in this field". (Translated from Swedish)

The assignment is:      ADOQuery.FieldByName('UnitSerialNumber').AsString := UnitSerialNumber;

And UnitSerialNumber is of type String.

Seems like some conversion from "empty" string to Null value is invoked in Delphi 2009!?

Any ideas?

regards, Mikael

Replies