TParam Collection has a NULL owner!

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
gb
Posts: 42
Joined: Wed 05 Mar 2008 12:32

TParam Collection has a NULL owner!

Post by gb » Wed 17 Nov 2010 14:35

Hi!

We're evaluating to change into UniDac and on our tests
there's an incompatibility between TParams from a TQuery
or TSQLQuery and the ones from TUniQuery, namely it's
collection has a NULL owner.

We have some functions that only get a TParam as argument,
from that we would get it's Dataset from the collection owner.

Eg:
void DoSomethingWithParam(TParam *p) {
struct C_ : TCollection { using TCollection::GetOwner; };
TDataSet *ds = static_cast
((static_cast(Param->Collection))->GetOwner());
if ( ds->ClassName() == "TSQLQuery" ) {
// ...
} // else if ( ds->ClassName() == "TQuery" ) { ...
}

As mentioned, it works fine with the standard components
because the usual owner of Params collection is the Dataset
itself, which is not the case with TUniQuery.

Any idea if it's "fixable"? To be fair TUniQuery is pretty
much compatible with the ones from BDE or DBX, but there's
still some little glitchs that make it derail.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 18 Nov 2010 16:35

Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next UniDAC build.

Post Reply