🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: NULL fields

#4503
From: Harold Howe (TeamB)
Date: Mon, 10 Dec 2001 16:29
18 lines
1783 bytes
> this : ADOQuery1->Parameters->Items[0]->Value = NULL;
> ... 
> How can I insert data with NULL value ?

You need to be careful here. You need to distinguish carefully between NULL and
System::Null. System::Null is a constant that represents a null variant object. This
is what you want to assign to your parameter. NULL is very different. It is not a
variant. In C++, NULL is typically used to represent a nil pointer. NULL is usually
#defined to be 0, or to be a (void *)(0). 

The C++ version of NULL has nothing to do with databases or NULL fields in a table.
NULL in C++ is very different than NULL in database speak. If you assign NULL to a
field or parameter, you will probably end up with a field that contains the string
"0" or the number 0. If you want the field to be NULL in database terms, assign it a
value of System::Null in code.

Harold Howe [TeamB]
http://www.bcbdev.com
Technical Details
Message-ID: <3C14E2EE.AAC0CEBF@bcbdev.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!newsfeed.mesh.ad.jp!uunet!osa.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews
References: <3c0281a0_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,b547a45fc63b1283
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-12-10 08:38:56 PST
Message-ID: <3C14E2EE.AAC0CEBF@bcbdev.com>
Date: Mon, 10 Dec 2001 10:29:34 -0600
From: "Harold Howe (TeamB)" <hhowe@bcbdev.com>
X-Mailer: Mozilla 4.03 [en] (WinNT; I)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: NULL fields
References: <3c0281a0_1@dnews>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 24.22.227.236
X-Trace: dnews 1008001402 24.22.227.236 (10 Dec 2001 08:23:22 -0800)
Lines: 18
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!newsfeed.mesh.ad.jp!uunet!osa.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews