I sometimes get an exception in midas.dll when I load XML data into a
TClientDataset using ACds.LoadFromStream().
The code looks like:
var
XMLText: string;
begin
// Load XMLText
...
if ACds.Active then ACds.Close;
stream := TStringStream.Create( XMLText );
try
try
stream.Position := 0;
ACds.LoadFromStream( stream );
except
raise;
end;
finally
stream.Free;
end;
ACds.LoadFromStream( stream ) is the line causing the problem. It happens
only when XMLText describes a dataset with nested datasets, like a person
with phone numbers, addresses, etc...
I have read lots of things in the newsgroups about this, but no good answer
yet.
Anybody knows a way around?
I use Delphi 5, I even tried to use Delphi 6 midas.dll.
Thank you.
Patrick.
Subject: Cannot use Delphi 6 MIDAS.DLL in Windows 2000 !
Subject: Re: Access Violation in LoadFromFile (XML)
As you said... no solution yet.
- Carlos
"Patrick Charles" <pcha...@deltaware.com> escreveu na mensagem
news:3c48300e$1_2@dnews...
"Carlos H Cantu" <cantu_...@cnptia.embrapa.br> wrote in message
news:3c484ea7_1@dnews...
- Carlos
"zlatko" <Zla...@zms.pan> wrote in news:3c4ad6f4_1@dnews:
I am thinking about a function that would scroll through the XML file and
create fields at run time...
This could be a way around the problem.
Patrick
"Carlos H. Cantu" <warmboot...@hotmail.com> wrote in message
news:Xns919D71AA81...@207.105.83.65...
"Patrick Charles" <pcha...@deltaware.com> wrote in message
news:3c4dcd72$1_1@dnews...
Thank you for your answer.
my problem is when I load datasets containing nested datasets.
Anyway, I hope that the complete fix will fix this also.
Do you know if the fix will be for Delphi 5 or/and Delphi 6, or Delphi 6
only?
Right now I am using Delphi 5.
Thanks again.
Patrick Charles
535 North River Road
Charlottetown PE C1E 1J6
Canada
(mailto:pcha...@deltaware.com)
Phone: (902) 628-4582
Fax: (902) 628-4660
"Dan Miser (Borland)" <dmi...@borland.com> wrote in message
news:3c4f8694$1_2@dnews...
In article <3c48300e$1_2@dnews>, pcha...@deltaware.com says...
>
> I sometimes get an exception in midas.dll when I load XML data into a
> TClientDataset using ACds.LoadFromStream().
One thing you might try is calling MergeChangeLog before saving the
dataset to the stream in the first place (iow, put ACDS.MergeChangeLog on
the line before ACDS.SaveToStream()).
Worked wonders for us, but we're using the MIDASLib.DCU, and not the
MIDAS.DLL, so there might be some differences. And we're on D6. YMMV.
M.
"Martin" <LLOQPT...@spammotel.com> wrote in message
news:MPG.16c093269...@forums.borland.com...