Article View: borland.public.cppbuilder.database.ado
Article #5167Setting a TParameter to NULL
From: John Biddle
Date: Wed, 01 Aug 2001 17:29
Date: Wed, 01 Aug 2001 17:29
26 lines
1783 bytes
1783 bytes
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:
<3b683e99$1_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.he.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,fd4a14ecd8537884,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-08-01 10:41:24 PST From: "John Biddle" <johnb@vigilant-systems.com> Newsgroups: borland.public.cppbuilder.database.ado Subject: Setting a TParameter to NULL Date: Wed, 1 Aug 2001 10:29:59 -0700 Lines: 29 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: <3b683e99$1_1@dnews> X-Trace: dnews 996687513 63.88.181.186 (1 Aug 2001 10:38:33 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.he.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews