Re:Adding a row with TQuery
You can use a Tquery object and add a row to the table by doing this:
query.Sql.Add('Insert into yourtable(Col1, Col2,Col3) values('Blah', 'Blah',
'Blah');
query.ExecSql;
This will insert a record into the table without you having to make a query
object active.
--
Michael Glatz
mgl...@caiso.com
Quote
r...@snowcrest.net wrote in message <36E6E94F.CD18B...@snowcrest.net>...
>Scenario: Database table with many rows; don't wish to retrieve all rows
>into TDBGrid; so you open a form with the grid, and the TQuery is
>inactive (i.e. no rows displayed in grid); you might provide a custom
>query
>option to query the db to retrieve rows; cached updates and updateSQL
>components are used.
>Problem: What if the user opens the form and wants to add a row instead
>of querying; the TQuery is inactive.
>Question: Is there a way to add a row when the TQuery is inactive
>( i.e. how do you add a row without first activating the dataset and
>retrieving 0..* row(s))? Any alternative solutions that are geared
>towards a generic framework viewpoint where I can't make direct
>references to specific instances of TwwQuery or it's SQL statement?
>Michael Sumption
>Shasta County I.S., CA
>r...@snowcrest.net