Page 1 of 1

TParam Collection has a NULL owner!

Posted: Wed 17 Nov 2010 14:35
by gb
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.

Posted: Thu 18 Nov 2010 16:35
by Dimon
Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next UniDAC build.