Re: Sub Selects?

From: Júlio Silva (jquim_at_kqnet.pt)
Date: 03/23/04


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
>
>



Relevant Pages

  • Sub Selects?
    ... I'm currently writing my first Delphi application, ... to a Jet database. ... I have to pull out data from one table, based on items selected in the UI. ... SELECT name, dob, income FROM Customer WHERE CustomerID IN ...
    (borland.public.delphi.database.ado)
  • Re: Array Functions from Alan Beban
    ... >Is there a way to pull a list of numbers from another worksheet. ... >need to do is pull all the customer numbers from a csv file and then ... >the remaining info from the csv file. ... example) and run Data> Filter> AutoFilter. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Not connecting to records
    ... equal to the value actually in the control AcctNo. ... OR does "AcctNo" refer to the field of the records that I want to pull? ... is matching the Customer ID, which is giving me the result below. ...
    (microsoft.public.access.forms)
  • Re: Showing records in a Sub form based on TWO combo boxes on Main
    ... on my first Combo which is where I select the Customer. ... It is this value that i want to firstly filter my form on ... When I select "Air New Zealand" I immediately getting a Runtime Error 2448, ... Private Sub cboFilterCust_AfterUpdate ...
    (microsoft.public.access.forms)
  • Re: Not connecting to records
    ... I have several account numbers from which I want to use the same price ... what it does is pull the special pricing based upon the Cust_Cust_ID ... Acct No Product Price List Acct Number ... In the "customer number" after update event, ...
    (microsoft.public.access.forms)