XML question

  • Thread starter Thread starter Glyn Meek
  • Start date Start date
G

Glyn Meek

I have a statement in my code...

Try
MyDataset.ReadXml(MyTemplate.myFileName)
Catch EXC As Exception
....
End Try

which will fail (as expected) when I try to read in an old format 'record'
where one or more of the data elements in my schema is missing from the
'record'. The problem I have is that I am trying to process two different
formats of 'old' records, one of which has Field A missing, and one of which
has Field B missing.

1) How can I tell within the Catch part of the exception processing whether
the ReadXML failed because it coudn't find Field A or couldn't find Field B?

and

2) Will it have read in all the other fields that ARE present even though it
generated an exception?

Regards

Glyn Meek
 
You have the choice of either reading into a particular format, then trying
another format and then trying another, or switching to a routine that does
this for you. Or, you can query the XML to figure out the format prior to
attempting to load and avoid the try ... catch altogether.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Back
Top