Toracledataset datasource

heuserj

Member²
I am using DOA and the Woll2Woll wwdbgrid component in an app. I found an example of implementing sorting of the grid on this forum. The procedure requires 2 parameters

1. The TOracledataset
2. The field name (which I get from the grid column button click event)

I can make everything work if I explicitely specify the TOracledataset. What I would like to be able to do is read the value of the TOracledataset in. I have tried:

procedure Tsimplegrid.wwDBGrid1TitleButtonClick(Sender: TObject;
AFieldName: String);
var
ds: TOracledataset;

begin
ds := wwdbgrid1.DataSource.DataSet;

and I get an error saying:

TOracledataset and TDataset are imcompatible types

Does anyone have a suggestion?

Thanks

John
 
You need to apply a typecast, so that the compiler knows that the DataSet is in fact a TOracleDataSet:

ds := wwdbgrid1.DataSource.DataSet as TOracleDataSet;

------------------
Marco Kalter
Allround Automations
 
Back
Top