Re: Sub Selects?
From: Júlio Silva (jquim_at_kqnet.pt)
Date: 03/23/04
- Next message: Júlio Silva: "Re: CheckMod.db"
- Previous message: Paul Redstone: "Undefined function accessing dBase"
- In reply to: Michael Koziarski: "Sub Selects?"
- Next in thread: Brian Bushay TeamB: "Re: Sub Selects?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 23 Mar 2004 22:45:28 -0000
Michael
The way I use to pass over parameters is something like:
procedure TDaMo.QuPayNTBUCreate( sFile,
sOrder:string);
begin
with DaMo.QuPayNTBU do
begin
Close;
with SQL do
begin
Clear;
Add(' SELECT ');
Add(' ID ');
Add(' , NAME ');
Add(' FROM '+sFile);
Add(' ORDER BY ' + sOrder );
end; // with SQL do
Open;
end; // with DaMo.QuPayNTBU do
end;
May be is not the best "programming pratices" but it works for select insert
filter delete ...
Good luck
"Michael Koziarski" <michael@koziarski.com> wrote in message
news:405ffff5@newsgroups.borland.com...
> Hey guys,
>
> I'm currently writing my first Delphi application, it's using ADO to
connect
> to a Jet database.
>
> I have to pull out data from one table, based on items selected in the UI.
> Now, what I'd like to do is write something like:
>
> SELECT name, dob, income FROM Customer WHERE CustomerID IN
> (1,2,3,4,5,6,9,294)
>
> But I can't figure out how to do this with Parameters or Filters. Is
there
> some nice Delphi DB technique to do this, or should I just build up the
SQL
> and escape things manually.
>
> Alternatively, should I just pull back all the records and skip the ones
not
> relevant (potentially very slow).
>
>
> Cheers
>
> Koz
>
>
- Next message: Júlio Silva: "Re: CheckMod.db"
- Previous message: Paul Redstone: "Undefined function accessing dBase"
- In reply to: Michael Koziarski: "Sub Selects?"
- Next in thread: Brian Bushay TeamB: "Re: Sub Selects?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|