Shamil Salakhetdinov
shamil at users.mns.ru
Sun Sep 4 14:44:02 CDT 2005
Marty, Yes, error handling is needed of course. And yes, using XML schema to get the fields' list would be a useful addition. If you have time and if you wanted to extend this code http://smsconsulting.spb.ru/shamil_s/topics/xmltests.htm then please make your corrections and I will publish them there with all the credits to your corrections and solution... Thank you, Shamil ----- Original Message ----- From: "MartyConnelly" <martyconnelly at shaw.ca> To: "Discussion of Hardware and Software issues" <dba-tech at databaseadvisors.com> Sent: Sunday, September 04, 2005 11:03 PM Subject: Re: [dba-Tech] XML to access? > I have some basic error handler code for SAX parsing both with and > without an xsd file > Avoids a lot of head scratching. > I didn't think of building fields in the table this way, I was going to > do it from an xsd file. > > 'To invoke error handling > > Set m_oIError = New IErrorHandler > with Reader > Set .errorHandler = m_oIError > .putFeature "schema-validation", True > .putFeature "exhaustive-errors", True > .putFeature "use-schema-location", False 'not using xsd file > and > '---------------------------------------------------- > 'Class IErrorHandler.cls > '---------------------------------------------------- > > > Implements IVBSAXErrorHandler > > Private Sub IVBSAXErrorHandler_error(ByVal oLocator As > MSXML2.IVBSAXLocator, strErrorMessage As String, ByVal nErrorCode As Long) > MsgBox "Error " & strErrorMessage & " - line " & oLocator.lineNumber > & " ,column " & oLocator.columnNumber & _ > " - " & oLocator.publicId > Debug.Print strErrorMessage & " - line " & oLocator.lineNumber & " > ,column " & oLocator.columnNumber & _ > " - " & oLocator.publicId > End Sub > > Private Sub IVBSAXErrorHandler_fatalError(ByVal oLocator As > MSXML2.IVBSAXLocator, strErrorMessage As String, ByVal nErrorCode As Long) > MsgBox "Fatal " & strErrorMessage & " - line " & oLocator.lineNumber > & " ,column " & oLocator.columnNumber > Debug.Print strErrorMessage & " - line " & oLocator.lineNumber & " > ,column " & oLocator.columnNumber > > End Sub > > Private Sub IVBSAXErrorHandler_ignorableWarning(ByVal oLocator As > MSXML2.IVBSAXLocator, strErrorMessage As String, ByVal nErrorCode As Long) > MsgBox "Warning " & strErrorMessage & " - line " & > oLocator.lineNumber & " ,column " & oLocator.columnNumber > Debug.Print strErrorMessage & " - line " & oLocator.lineNumber & " > ,column " & oLocator.columnNumber > End Sub > > '---------------------------------------------------- > > Shamil Salakhetdinov wrote: > > >Jon, > > > >I did publish here http://smsconsulting.spb.ru/vdv/?postid=24 several > >relatively simple methods to code XML import in VBA. > > > >HTH, > >Shamil > > > >P.S. What is your XML file structure? > > > >----- Original Message ----- > >From: "Jon Tydda" <Jon.Tydda at alcontrol.co.uk> > >To: "Dba-Tech (E-mail)" <dba-tech at databaseadvisors.com> > >Sent: Thursday, September 01, 2005 7:38 PM > >Subject: [dba-Tech] XML to access? > > > > > > > > > >>Hi all > >> > >>I've not used access much, but as the IT guy here, I've been asked to try > >>and find a way to import data into an access db from an xml sheet, which > >> > >> > >is > > > > > >>seemingly the only way we can oupput from the software we have. > >> > >>So in view of it being the blind leading the blind, as such, is there a > >>SIMPLE way to do it? > >> > >> > >>Jon > >> > >> > >> > >> > > > > > > > > -- > Marty Connelly > Victoria, B.C. > Canada > > > > _______________________________________________ > dba-Tech mailing list > dba-Tech at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-tech > Website: http://www.databaseadvisors.com