Domanda

First, please don't ask me why I need to do this. Unless you can tell me how to convert a TFDDataset directly to a _RecordSet, please, don't ask. :-)

So, this is my question:

Give a TFDDataset, how can I convert that dataset into a TADODataset?

The TFDDataMove component will only move to a FireDac dataset, not to anything else.

What strategy would you recommend? Brute force (iterate over fields and records...) is the only thing I can think of, but perhaps I'm missing some easier or better way.

Thanks.

È stato utile?

Soluzione

OK, I ported it to Delphi XE4 and also started adding bookmark support so you can hook it with a TADODataSet and use TDataSource and data-aware controls. There still seems to be a little bug somewhere which causes the dbgrid raise a "grid index out of range" error if you navigate to the last record immediately after switching to the ADO dataset. Anyway, here's what I have.

Merry Christmas, Nick!

ADORecordSet.pas

Test project: Project1.dpr, Unit1.pas, Unit1.dfm

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top