Hi Mark,
I tend to agree with James. Other things you might think about :
* My earlier TTables would initially populate grids etc on form
creation. Using IBQueries, I now open a form and display an empty
resultset via an initial SQL of (say) Select xxx Where JobCode <
-1. The user is able to do extensive filtering (InfoPower
FilterDialog), which modifies the original SQL. I delete my Where
clause (in the BeforeOpen event) and put "Where" in front of the
lines added by the FilterDialog. Not much code, works well, and
flexible.
* When possible, it's good to code the Select statement to retrieve
only necessary columns, then create the static field list and setup
the DisplayLabels and their sizes as you want them. Then you don't
have to worry about this stuff anymore for grids and
RecordViewPanes etc.
HTH,
Craig.
James Low wrote:
> Well, heres a start from someone not really in the know either: 1)
> I have a query for each sensible entity (Address, Contact mechanism,
> Bill, Job). That query has an sqlstring. 2) Where there is an
> obvious relationship between entities and if using dataaware controls
> I'll link child queries to their parent with parametrised queries.
> Otherwise I might build an sql string to represent the child. 3) I
> have one Utility query which I create odds and sodds queries, such as
> for establishing if records exist/ dont exist etc.Therefore ... a mix,
> the goal being ease of maintaintenance, clear logic and not dragging
> too much data onto the client. But, sometimes its easier to build
> queries in code - and more transparent so I guess its horses for
> courses.
>
> -----Original Message-----
> From: Mark Howard [mailto:[EMAIL PROTECTED]]
> Sent: 19 June 2001 13:49
> To: Multiple recipients of list delphi
> Subject: [DUG]: Use of TQuery's
>
> Hi I'm about to embark on a conversion from Paradox to IB
> and I have a question about common practice in terms of the
> use of TQuery's in place of TTables. My current app opens a
> TTable, for each Paradox table that it uses, at startup and
> closes them all at closedown. There appear to be 3 general
> ways that one can use TQuery's:1. Just like a TTable, with
> a Select * from MyTable in the SQL property (at one
> extreme);2. As a purely open Query with nothing in either
> parameters or SQL, relying on code supplied by the app at
> runtime. In this case one TQuery could be used to access
> several files at different times.3. With both SQL and
> parameters specified at design time, in which case the
> TQuery is for a predetermined purpose ( and attached to a
> specific file). In the absence of ANY knowledge about what
> is normal, I'd be grateful to hear of any general guidelines
> on what approaches are adopted by those in the
> know. TIA Mark
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"