Unidac and FR4 ADO do not get along.
Posted: Thu 21 Jul 2011 06:16
Yes, I know you can use Unidac in FR4, but I have some reports using ADO. When the application loads the report file, it setup the ADO dataset in the report. This is when Unidac starts to break down. What happens is the Unidac datasets are closed and the Unidac connection component unassigned from all Unidac datasets.
I don't have Uni's source, so this call stack is based on VCL debug DCUs.
TCustomAdoDataSet.AssignCommandText, this is the beginning of the end of Unidac's connection. It's when the following line of code is called that Unidac starts to shutdown the datasets...
That line of code is from AdoDb.pas, TParameters.InternalFresh.RefreshFromOleDb.
Is there a way to get Unidac and Ado to work together in the same application?
I don't have Uni's source, so this call stack is based on VCL debug DCUs.
Code: Select all
DB.TDataSet.SetActive(???)
:006874b2 TCustomDADataSet.SetActive + $42
ADODB.TADOCommand.AssignCommandText('select M.Doni_Num'#$D#$A',M.Assignor_Num'#$D#$A',D.Document_Title'#$D#$A',D.Internal_Title'#$D#$A',D.Document_Category'#$D#$A',D.Document_ID'#$D#$A'from Master M'#$D#$A'inner join Document D on D.Document_Domain_Cd=M.Document_Domain_Cd'#$D#$A'inner join Master_Document MD on M.Master_ID=MD.Master_ID and MD.Document_ID=D.Document_ID'#$D#$A'where exists (select 1 from Master_Document_Activity MDA '#$D#$A' where MDA.Master_Document_Id=Md.Master_Document_ID'#$D#$A' and MDA.Document_Activity_Cd='DOCREQSENT')'#$D#$A'and not exists (select 1 from Master_Document_Activity MDA '#$D#$A' where MDA.Master_Document_Id=Md.Master_Document_ID'#$D#$A' and MDA.Document_Activity_Cd='DOCREQREC')'#$D#$A'order by D.Internal_Title, M.Doni_Num '#$D#$A,False)
ADODB.TADOCommand.SetCommandText(???)
ADODB.TCustomADODataSet.SetCommandText(???)
ADODB.TADOQuery.QueryChanged(???)
WideStrings.TWideStringList.Changed
WideStrings.TWideStringList.SetUpdateState(???)
WideStrings.TWideStrings.EndUpdate
WideStrings.TWideStrings.Assign(???)
frxADOComponents.TfrxADOQuery.OnChangeSQL($1347DA0)
Classes.TStringList.Changed
Classes.TStringList.SetUpdateState(???)
Classes.TStrings.EndUpdate
Classes.TStrings.SetTextStr(???)
frxXMLSerializer.TfrxXMLSerializer.XMLToObj('Name="dstReport" UserName="dstReport" CloseDataSource="True" FieldAliases.Text="" BCDToCurrency="False" IgnoreDupParams="False" SQL.Text="select M.Doni_Num
,M.Assignor_Num
,D.Document_Title
,D.Internal_Title
,D.Document_Category
,D.Document_ID
from Master M
inner join Document D on D.Document_Domain_Cd=M.Document_Domain_Cd
inner join Master_Document MD on M.Master_ID=MD.Master_ID and MD.Document_ID=D.Document_ID
where exists (select 1 from Master_Document_Activity MDA
where MDA.Master_Document_Id=Md.Master_Document_ID
and MDA.Document_Activity_Cd='DOCREQSENT')
and not exists (select 1 from Master_Document_Activity MDA
where MDA.Master_Document_Id=Md.Master_Document_ID
and MDA.Document_Activity_Cd='DOCREQREC')
order by D.Internal_Title, M.Doni_Num " CommandTimeout="30" Database="conReport" LockType="ltReadOnly" PropData="05704C65667402300470546F7002500A506172616D65746572730100"',$10BC1A0)Code: Select all
OLEDBCommand := (Command.CommandObject as ADOCommandConstruction).OLEDBCommand as ICommand;Is there a way to get Unidac and Ado to work together in the same application?