Re: locate method problem ???



ray wrote:

Delphi 7
trying to use ADO Dataset without connection reading prevously stored
XML file from disk The error that pos up is EOleException "Element
was not closed".

Please help me to solve this I just do not understand the reason.

Code Fragment:

Var
OldDataset:TADODataset;
mn: TStringList;
Begin
OLDDataset:=TADODataset.Create(nil);
mn:=TStringList.Create;
try
OldDataset.LoadFromFile(LocalFile);
mn.Delimiter:=';';
mn.DelimitedText:=Params.Values['primarykey']; //
('2006','2008','389k','400k') thats the values if

OldDataset.Locate(params.Values['primarykey'],VarArrayFromStrings(mn),
[]) then OldDataset.Delete; //** here where the error happens
{........more code here........} finally OLDDataset.free;
mn.free;
end

End

Each XML node must have a closing tag, the following XML snippet is
valid
----%<----

<Root>
<Node1 />
<Note2> value </Note2>
</Root>

----%<----

<Node1 /> is equivalent to <Node1></Node1>

this is not valid:

----%<----

<Root>
<Node1>
<Note2> value </Note2>
</Root>

----%<----

For more information see the W3C Schools XML Tutorial.


HTH

Graham Harris
--

.



Relevant Pages

  • Re: Illegal Charaters in path
    ... In the sample code I used the LoadXml first and got Data at the root ... Then I tried load, well I ... I have a simple XML ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Sort xml?
    ... An XSLT stylesheet can sort XML documents, for instance if the input XML ...
    (microsoft.public.dotnet.xml)
  • Re: Retrieving and Combining XML
    ... In SQL Server 2005, you can use ROOTin the FOR XML clause. ... the root element added on the client. ... I managed to make it work by adding a parent node in my ...
    (microsoft.public.sqlserver.xml)
  • Re: Help: I cannot selectNodes with a simple XPath expression
    ... % [dom parse $xml] documentElement root ... So without an anonymous namespace, ...
    (comp.lang.tcl)
  • Re: extracting part of xml
    ... Given the following an XML file called items.xml with the following ... public void readItemsthrows FileNotFoundException, ... // get the list of children of the root element ... Jean-Paul H. ...
    (comp.lang.java.programmer)