Article View: borland.public.cppbuilder.database.ado
Article #1227Re: TADOQuery->Parameters->Index[]->Value
From: Arnie Mauer
Date: Thu, 23 Sep 2004 15:30
Date: Thu, 23 Sep 2004 15:30
23 lines
1654 bytes
1654 bytes
"Stephane Baillargeon" <info@solutionsgestico.com> wrote in message
news:4151b7fb$1@newsgroups.borland.com...
> Hi,
>
> What is wrong with this code? I get a list out of bounds (0)
> exception.
> Do I have to initialize a TParameters list before and assign it to
> the
> query?
>
> TADOQuery *padoQry = new TADOQuery(NULL);
>
> padoQry->SQL->Add(" SELECT * FROM Test WHERE Test_NRI = : Test ");
>
> padoQry->Parameters->Items[0]->Value = 3683; // <---access violation
>
Your code above doesn't show the query as being hooked to a connection
or otherwise connected to a DB. That being the case, no parameter
objects will be created because the query can't determine their type.
Try setting the connection before adding the SELECT.
- Arnie
Technical Details
Message-ID:
<4152ec29@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4151b7fb$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,99111c154f0d657d X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Arnie Mauer" <xxx@nowhere.net> Newsgroups: borland.public.cppbuilder.database.ado References: <4151b7fb$1@newsgroups.borland.com> Subject: Re: TADOQuery->Parameters->Index[]->Value Date: Thu, 23 Sep 2004 11:30:14 -0400 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 12.29.236.34 Message-ID: <4152ec29@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1095953449 12.29.236.34 (23 Sep 2004 08:30:49 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail