🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: NULL fields

#4563
From: Jakob Petersen
Date: Thu, 29 Nov 2001 16:13
36 lines
1958 bytes
Hi,

The Clear() method on the parameter wont work with strings.
Use

 ADOQuery1->Parameters->Items[0]->Value = System::Null

Instead which is the ONLY (XP) solution on ADO parameter clearing problems.

Best Regards,

Jakob Petersen
Microhouse

"mafi" <mafi@multimania.com> skrev i en meddelelse news:3c0281a0_1@dnews...
> Hi !
> I'm using a TADOQuery to insert data into a table with the Parameters from
> another table.
> When I execute the query, if I got a NULL field I got a EOleException that
> says "Parameter object is improperly defined. Inconsistent or incomplete
> information was provided"
>
> My code's like this:
> ADOQuery1->Parameters->Items[0]->Value =
> ADOQuery2->FieldByName("field1")->AsString;
> ...
>
> this : ADOQuery1->Parameters->Items[0]->Value = NULL;
> doesn't work as well, and the paNullable option of the Attributes property
> doesn't change anything.
>
> How can I insert data with NULL value ?
>
> Thanks
>
>
Technical Details
Message-ID: <3c065e0c$1_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!204.71.34.15!news-out.cwix.com!newsfeed.cwix.com!news.maxwell.syr.edu!news1.optus.net.au!optus!intgwlon.nntp.telstra.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-11-29 08:32:25 PST
From: "Jakob Petersen" <Jakob@microhouse.dk>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3c0281a0_1@dnews>
Subject: Re: NULL fields
Date: Thu, 29 Nov 2001 17:13:54 +0100
Lines: 38
Organization: Microhouse Aps
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 212.242.243.79
Message-ID: <3c065e0c$1_2@dnews>
X-Trace: dnews 1007050252 212.242.243.79 (29 Nov 2001 08:10:52 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!204.71.34.15!news-out.cwix.com!newsfeed.cwix.com!news.maxwell.syr.edu!news1.optus.net.au!optus!intgwlon.nntp.telstra.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews