XML question

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
 
G

Guest

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!
***************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top