🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to use parameters in TADOQuery

#3115
From: Dmitry
Date: Wed, 18 Dec 2002 16:18
81 lines
3686 bytes
Thanks Viatcheslav.

I 'll check it obligatory.
I never thought that it is possble to use parameter without (":"char)

Thanks.


"Vassiliev V.V." <news@vassilievvv.mtu-net.ru> �������/�������� � ��������
���������: news:3e00828c@newsgroups.borland.com...
> For me (tested in D7, BCB6) this works (Northwind database is used):
>
> Master query:
>
> Select * from customers
>
> Details query:
>
> Parameters CustomerID VarChar(50);
> Select * from Orders O
> where (O.CustomerID = CustomerID) and (O.ShipAddress > CustomerID)
>
> CustomerID in details query is parameter - but it has Access syntax, not
> Borland (no ":" char). To make it work you may need open Parameters
property
> dialog and display parameter properties. Set also TADOQuery.Prepared to
> True.
>
> Please not that this query syntax is MS Access specific and most probable
> will work only with Jet databases.
>
> ----------------------------------------------------------------
> Regards,
> Viatcheslav V. Vassiliev
> http://www.oledbdirect.com
> The fastest way to access MS SQL Server, MS Jet (MS Access)
> and Interbase (LCPI provider, http://ibp.lcpi.lipetsk.ru) databases.
> "Dmitry" <programmer@mail.spbnit.ru> �������/�������� � ��������
���������:
> news:3e004817@newsgroups.borland.com...
>
> >
> > > Parameter is not field and fields are not directly related with
> > parameters.
> > >
> > > In Access you can define parameters inside query (that is not BDE-like
> > > syntax ":param" that is supported by ADO Express).
> > > Your query will look like:
> > >
> > > Parameters Param1 Int;
> > > SELECT * FROM detail_table WHERE address_id =Param1 AND something_else
> > > =Param1
> >
> > Dear sir.
> > I usderstand. But my goal is not write special code for assigning of
> > parameters.
> > I'm talking just about case of assigning Datasorce property to
TADOQuery.
> > In this case when master dataset scrolls, VCL will automatically
> substitute
> > parameters in detail dataset IF names of some fields in master dataset
are
> > equal to names of parameters. AND You know about that.
> > But the problem of this example is that it will not work in such mode
> > because
> > VCL will assign only first parameter.
> >
> > Can you tell, do your components solve this problem.
> >
> > P.S
> > I use Assess
> > Sincerely yours.
> > Dmitry.
> >
> >
> >
> >
> >
> >
>
>
Technical Details
Message-ID: <3e00aa4e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3dfecc40@newsgroups.borland.com> <3dfee4ba@newsgroups.borland.com> <3dff15d6@newsgroups.borland.com> <3dff66dd@newsgroups.borland.com> <3e004817@newsgroups.borland.com> <3e00828c@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,d6b087b7370736cc
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-12-18 09:09:43 PST
From: "Dmitry" <programmer@mail.spbnit.ru>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3dfecc40@newsgroups.borland.com> <3dfee4ba@newsgroups.borland.com> <3dff15d6@newsgroups.borland.com> <3dff66dd@newsgroups.borland.com> <3e004817@newsgroups.borland.com> <3e00828c@newsgroups.borland.com>
Subject: Re: How to use parameters in TADOQuery
Date: Wed, 18 Dec 2002 19:18:36 +0300
Lines: 83
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: 212.48.199.27
Message-ID: <3e00aa4e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1040230990 212.48.199.27 (18 Dec 2002 09:03:10 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail