๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: NULL Parameters in TADOQuery

#421
From: Ruben Lopez
Date: Tue, 21 Nov 2006 12:10
40 lines
2286 bytes
Thanks for your reply.

And excuse me. I put the Property->Items[]->Value in mi source code but 
I forgot put the "->Value" in the question.

The problen it's that I can't put a NULL value in a property.
If I put NULL in a Integer value, it is converted to 0.

The q->Parameters->ParseSQL(q->SQL->Text,true); works fine, create all 
of the params for the q->SQLText query.

Thanks again.

Clayton Arends escribi๏ฟฝ:
> Items[] returns an object of type TParameter.  Setting that to NULL is not 
> what you want to do.  You want to access the properties of the returned 
> object.  Try this instead:
> 
>   q->Parameters->Items[0]->Value = 1;
>   q->Parameters->Items[1]->Value = NULL;
>   q->Parameters->Items[2]->Value = NULL;
> 
> In some cases you might have to set the type of the parameter correctly:
> 
>   q->Parameters->Items[1]->DataType = ftString; // for example
> 
> Also, this isn't part of your problem but take a look at your following 
> code:
> 
>>   q->Parameters->Clear();
>>   q->Parameters->ParseSQL(q->SQL->Text,true);
> 
> If ParamCheck is set to true for the query "q" (which it is by default) then 
> this code is already being performed when q->SQL is set.  There is no need 
> to do it twice.
> 
> HTH,
> - Clayton 
> 
> 
Technical Details
Message-ID: <4562ec92$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4561d245$1@newsgroups.borland.com> <4561db48$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,ef2115b40e2af41
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
Date: Tue, 21 Nov 2006 13:10:11 +0100
From: Ruben Lopez <ruben.lopez@sica.es>
User-Agent: Thunderbird 1.5.0.8 (Windows/20061025)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: NULL Parameters in TADOQuery
References: <4561d245$1@newsgroups.borland.com> <4561db48$1@newsgroups.borland.com>
In-Reply-To: <4561db48$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 80.59.94.142
Message-ID: <4562ec92$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1164110994 80.59.94.142 (21 Nov 2006 04:09:54 -0700)
Lines: 40
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail