Using TOraQuery with TDBGrid

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Wojtek

Using TOraQuery with TDBGrid

Post by Wojtek » Thu 02 Dec 2004 13:44

Hi, can anyone tell me how one present query resutls (from TOraQuery) in a TDBGrid control? Is is possible?

It would be great if you could write a small loop as an example (in C++ or Delphi).

thanks from the bottom from my heart for any help :)

ThomasB
Posts: 6
Joined: Tue 09 Nov 2004 13:50
Location: Hannover, Germany

Re: Using TOraQuery with TDBGrid

Post by ThomasB » Thu 02 Dec 2004 23:10

Normally you don't need any kind of loop at all:

0. Place TOraSession (OraSession1) on the form.

1. Place TOraQuery (OraQuery1) on the form. Property Session is automatically set to OraSession1.

2. Place TOraDataSource(OraDataSource1) on the form, and set DataSet property to OraQuery1.

3. Place TDBGrid (or TCRDBGrid) on the form, and set the DataSource property to OraDataSource1.

4. Double click on OraQuery1 and fill in the SQL to select the data from the database.

5. Set the Active property of OraQuery1 to true. After DB login you can see your data in the grid, even at design time.

If you want to manipulate the data in the grid (insert, update, delete), you have to add the corresponding sql in OraQuery1. The built in SQL Generator is a big help for that.

Thomas

Wojtek

Post by Wojtek » Fri 03 Dec 2004 10:21

Thank you, now it works nice :)

Post Reply