🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Setting a TParameter to NULL

#5170
From: John Biddle
Date: Wed, 01 Aug 2001 21:17
48 lines
2215 bytes
Thanks!

Tharun, the exact opposite works.

I set the Attibutes to include pa_Nullable, the DataType to ftString

and the value to a NULL (not empty!) variant and it worked!



Guiliano, I will try that as well.


        John Biddle
        Vigilant Systems


"John Biddle" <johnb@vigilant-systems.com> wrote in message
news:3b683e99$1_1@dnews...
> I have a TADOQuery hooked up to a MS SQL Server 7.0 database.
> I am trying to execute a parameterized insert statement to update a
> VARCHAR(64) field that is nullable in the SQL database.
>
> ADO will not allow me to set this parameter to NULL.
> It always raises an exception:
> 'Parameter object is improperly defined.
> Inconsistent or incomplete information was provided'
>
> I have tried all of the following without success:
>
> Assigning the TParameter to an empty variant (VT_EMPTY).
> Assigning the TParameter to an null variant (VT_NULL).
> Setting the TParameter Attributes to pa_Nullable.
> Setting the TADOQuery ParamCheck to false.
>
> The query works fine if I replace the parameter in the SQL text with the
> NULL keyword.
>
> I have lots of parameters in this query and would really like to avoid
> having
> to generate the SQL at runtime.
>
> Any ideas?!?!?!?!?
>
>     John Biddle
>
>
>
Technical Details
Message-ID: <3b6873ed_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!news.stealth.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3b683e99$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,fd4a14ecd8537884
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-08-01 14:38:38 PST
From: "John Biddle" <johnb@vigilant-systems.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3b683e99$1_1@dnews>
Subject: Re: Setting a TParameter to NULL
Date: Wed, 1 Aug 2001 14:17:27 -0700
Lines: 50
Organization: Vigilant Systems, Inc.
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: 63.88.181.186
Message-ID: <3b6873ed_1@dnews>
X-Trace: dnews 996701165 63.88.181.186 (1 Aug 2001 14:26:05 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!news.stealth.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews