Board index » delphi » TQuery in BROWSE mode with empty result set without database interaction.

TQuery in BROWSE mode with empty result set without database interaction.

To a BDE-genius out there!

How do I get a TQuery in BROWSE mode with an empty result set without
having to send SQL to the databaseserver?

You probably wonder why on earth... I have a program where I need to
INSERT records before there is any other interaction with the db-server.
Doing that I would like to use the capabilities of persistent TFields in
the TQuery (Specially the elegant way of attaching formatting rules to
each TField). I know I could solve this by just running ExecSQL, but
that means duplication code for INSERTS where I have an open result set.

Thank you..
Havard Ostgaard.

 

Re:TQuery in BROWSE mode with empty result set without database interaction.


Drop a TQuery on your form and for the SQL use a "Select * from
<table>". Open the query in the object inspector. Create the persistent
fields and do your formatting. Close the query. You now have the
persistent fields in your EXE. Use a button on your form to do the
Insert.

Nick Spurrier (MoDESoft, UK)

Other Threads