Article View: borland.public.cppbuilder.database.ado
Article #5361Re: Empty String Parameters are Illegal in ADO?
From: Arnie Mauer
Date: Mon, 11 Jun 2001 12:02
Date: Mon, 11 Jun 2001 12:02
40 lines
2529 bytes
2529 bytes
Hmmm. Interesting. But, it doesn't work. BTW, using the Oracle OLE DB provider. When I assign NULL, the TParameter Value is 0 and the Size is -1. On an INSERT, it actually puts a "0" into the table column. I really want an empty value, not zero. However, I found that when I assign a NULL AnsiString or empty C string and then set the TParameter Size to -1, it seems to give the desired result. It seems unhappy only when the Size is zero. "BM" <m02x7z00@cwcom.net> wrote in message news:3b23a7eb_2@dnews... > First of all I'm more familiar to Delphi so I apologies for any > discrepancies. > Can't tell you why these things happen but from our experience if you have a > NULL string you must set the parameter to NULL (i.e check its a blank > string- if it is set Parameter.Value = NULL) otherwise you see this error. > Another advisable thing to do is initialise all parameters to NULL i.e. > before any parameters are set is loop through them and set their value to > NULL. > > BM > > > Arnie Mauer <arnie@marketexpert.com> wrote in message > news:3b20ed67_2@dnews... > > In a parameterized INSERT statement in a TADOQuery, when setting > > q->Parameters->ParamByName( "foo" )->Value = ""; > > will cause q->ExecSQL() to throw an excpetion of: "Parameter object is > > improperly defined. Inconsistent or incomplete information > > was provided." Same goes for a NULL AnsiString. > > > > The TParameter Value == NULL and Length == 0. The DataType > > has been properly set to ftString after the assignment. What's > > wrong with a NULL string? > > > > > >
Technical Details
Message-ID:
<3b24b35d$1_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3b20ed67_2@dnews> <3b23a7eb_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,bf8db65ec424c3c9 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-06-11 05:17:34 PST From: "Arnie Mauer" <arnie@marketexpert.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3b20ed67_2@dnews> <3b23a7eb_2@dnews> Subject: Re: Empty String Parameters are Illegal in ADO? Date: Mon, 11 Jun 2001 08:02:53 -0400 Lines: 42 Organization: VRMS X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 209.140.211.97 Message-ID: <3b24b35d$1_1@dnews> X-Trace: dnews 992260957 209.140.211.97 (11 Jun 2001 05:02:37 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews