Topic: [another way to do] MSXML2.DSOControl, error 80020009
Hi,
I use MSXML2.DSOControl to access data stored in a XML file. Everything works well as far as I don't pass an ADODB.Recorset as parameter to a recursive procedure... If I comment the line 22 all the records are read.
If I remove the comment and I let the program explore the sublevels, it crashs at the end of the first sublevel on the adoRS.MoveNext. The reference to adoRS is lost (even if it was working previously on the test adoRS.EOF).
You can download the sample project : http://codyssea.com/downloads/007.zip.
Any help is welcome, I have no hair left... and can't stop scratching my head.
Regards,
jihem
procedure Dump(iLvl:integer;var adoRS:Variant);
var
i:integer;
v:Variant;
begin
while not adoRS.EOF do
begin
for i:=0 to adoRS.Fields.Count-1 do
begin
if adoRS.Fields(i).Name<>'$Text' then
begin
if adoRS.Fields(i).Type=136 then
begin
// Dump(iLvl+1,adoRS.Fields(i).Value); // <-- line #22 ; crash if uncommented
end
else // =12
begin
log(IntToStr(iLvl)+': adoRS.Fields('+IntToStr(i)+') : '+adoRS.Fields(i).Name+' => '+adoRS.Fields(i).Value);
end;
end;
end;
adoRS.MoveNext;
end;
end;
https://jihem.itch.io