🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #5429

Zero-length strings

#5429
From: Curtis Reimer
Date: Wed, 02 May 2001 15:28
32 lines
1672 bytes
Hello,

When posting records to the database, I get the following error when we try
to put an empty string into a field.

Field 'tblLocation.Description' cannot be a zero-length string

The interesting portion of the code is essentially

tblLocation->Edit();
tblLocationDescription->AsString = description;
tblLocation->Post();

where
- tblLocationDescription is a TWideStringField
- description is an empty AnsiString

Why can't a string be set to zero-length?  The field is not part of the key,
required, etc.  Does it have something to do with variants being used within
the code?

Details you might like to know:

OS : WinNT SP6a
MDAC: V2.6
C++ Builder V5 Professional, Update Pack 1
ADO Express, including update
DB: Access 2000

Thank You,

Curt
Technical Details
Message-ID: <3af02729_2@dnews>
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,93d84733dfbac4d9,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-05-02 08:32:04 PST
Reply-To: "Curtis Reimer" <curtisr@lvcontrol.mb.ca>
From: "Curtis Reimer" <curtisr@lvcontrol.mb.ca>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Zero-length strings
Date: Wed, 2 May 2001 10:28:35 -0500
Lines: 35
Organization: L.V. Control Mfg. Ltd
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 205.200.67.18
Message-ID: <3af02729_2@dnews>
X-Trace: dnews 988817193 205.200.67.18 (2 May 2001 08:26:33 -0700)
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews