TADOQuery - using 2 detail parameters for same master field

From: Jon Scott (NOSPAMsupport_at_blueorbsoft.comNOSPAM)
Date: 02/28/04

  • Next message: Jon Scott: "Re: TADOQuery - using 2 detail parameters for same master field"
    Date: Sat, 28 Feb 2004 14:35:29 -0500
    
    

    I use TADOQuery on an Access database and have a master/detail relationship between two tables.
    On the detail table SQL, I have something like:

    SELECT * FROM Detail
    WHERE ((Detail.Field1 LIKE '%' + :PARENTFIELD + '%')
    OR (Detail.Field2 = :PARENTFIELD))

    However, I notice that TADOQuery only fills in the first parameter and ignores the second one
    (it is null). The only way I can get this to work is to manually fill in the parameters
    whenever a user moves between records on the master table and Requery the detail table. Is
    there a way to make this work using TADOQuery or another ADO descendant component (freeware)?
    Does using TADODataSet or TADOTable make any difference? I have yet to try those.

    -- 
    Thanks,
    Jon E. Scott
    Blue Orb Software
    http://www.blueorbsoft.com
    

  • Next message: Jon Scott: "Re: TADOQuery - using 2 detail parameters for same master field"

    Relevant Pages

    • Re: TADOQuery - using 2 detail parameters for same master field
      ... >I use TADOQuery on an Access database and have a master/detail relationship between two tables. ... >there a way to make this work using TADOQuery or another ADO descendant component? ... ADO doesn't support parameters of the same name in a query. ...
      (borland.public.delphi.database.ado)
    • Re: Truncated Blob Field in TADOQuery
      ... I used a TADOStoredProc instead and the problem went away. ... suspect that ti has to do with the manner in which TADOQuery handles ... and pumping it down into a MS SQL db locally. ... > of the parameter in the TADOQuery component before calling the ExecSQL ...
      (borland.public.delphi.database.ado)
    • Re: MSAccess and ADO
      ... database I use TADOQuery and SQL ... Stanko. ...
      (borland.public.delphi.database.ado)
    • Re: Which is faster??
      ... SQL inserts will always run faster that opening an entire table and posting. ... If you are using MS Access, TADOQuery should be faster, but not by much. ... using TADOTable components and essentially the code looks like this... ... change to INSERT and UPDATE SQL queries be faster?? ...
      (borland.public.delphi.database.ado)
    • Re: the dbgrid will be uneditable
      ... only sqlserver tables and the program running in delphi can generate that ... >>if using tadoquery and sql to join two tables,the dbgrid will be ...
      (borland.public.delphi.database.ado)