🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: NULL Parameters in TADOQuery

#420
From: Clayton Arends
Date: Mon, 20 Nov 2006 16:44
24 lines
1831 bytes
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: <4561db48$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4561d245$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-7-bit
From: "Clayton Arends" <nospam_claytonarends@hotmail.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <4561d245$1@newsgroups.borland.com>
Subject: Re: NULL Parameters in TADOQuery
Date: Mon, 20 Nov 2006 08:44:05 -0800
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 71.83.251.192
Message-ID: <4561db48$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1164041032 71.83.251.192 (20 Nov 2006 08:43:52 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail