Board index » delphi » Zero length string error

Zero length string error

Anybody know how to deal with zero length string errors.  I am converting an
existing application to D5, ADO, Access97 and often get errors when
inserting records.  I know Access has a property that allows zero length
strings, but I'm not sure how to get to it (or if that's even the right
thing to do) in Delphi.

Russell

 

Re:Zero length string error


On Fri, 4 Aug 2000 15:58:10 +0100, Russell Phaturos wrote
(in message <398ad6f8$1_1@dnews>):

Quote
> Anybody know how to deal with zero length string errors.  I am converting an
> existing application to D5, ADO, Access97 and often get errors when
> inserting records.  I know Access has a property that allows zero length
> strings, but I'm not sure how to get to it (or if that's even the right
> thing to do) in Delphi.

> Russell

Hi,

In order to avoid zero length errors I set the 'Allow Zero Length' field
property to True when I create the field. Here is the code I use:

// Create column 'B' - Allow Zero Lenght
MyColumn := CoColumn.Create;
MyColumn.Name := 'field B';
MyColumn.Type_ := adVarWChar;
MyColumn.ParentCatalog := Catalog;
MyColumn.Properties['Jet OLEDB:Allow Zero Length'].Value := True;
Table.Columns.Append(MyColumn, adVarWChar, 50);

Best regards
Nuno Mendes
--
------------------------------------------------------------------------
 Nuno Mendes                                    E-mail: nmen...@netc.pt
 Aveiro - Portugal
------------------------------------------------------------------------

Other Threads