[AccessD] Read XML File Using xsd Schema File

Gary Kjos garykjos at gmail.com
Fri Dec 4 06:20:51 CST 2009


Hi Paul,

Nothing to add here but I know you were wondering if you message made
it to the list. I don't do any XML work.

Good luck with it.

GK

On Thu, Dec 3, 2009 at 1:42 AM, Paul Hartland
<paul.hartland at googlemail.com> wrote:
> To all,
>
> We have been a given what looks to me like a fairly complex XML file, we
> have also been given a xsd schema file.  I tried using the SQLXMLBulkLoad
> object in VB6 and was getting the error
>
> Schema: relationship expected on 'Company'.
>
> The company that gave us both the files insist that the xsd is correct
> (according to my project manager).  I downloaded and installed Stylus Studio
> 2010, with which I loaded the XML, and then generated my own xsd schame
> file.  Tried again and this time get the same error as above, but instead of
> 'Company' the error was 'Groups'
>
> The VB6 code I am using is as follows:
>
> Dim objBL
>
> Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
> objBL.ConnectionString = "Provider=SQLOLEDB.1;Password=hermes;Persist
> Security Info=True;User ID=sa;Initial Catalog=XLTestCD;Data Source=AL-SQL1"
>
>
> objBL.KeepIdentity = True
>
> objBL.errorlogfile = "C:\XML_StylusStudio\Error.log"
>
> objBL.checkconstraints = True
> objBL.xmlfragment = True
> objBL.schemagen = True
> objBL.sgdroptables = True
>
> objBL.Execute "C:\XML_StylusStudio\newschema.xsd",
> "C:\XML_StylusStudio\CDFull_Original.xml"
> Set objBl=Nothing
>
> The object of the exercise being that we generate related tables in SQL
> Server 2005 of the XML data.
>
> Would be grateful if anyone could help with this (would be happy to send
> example XML file and the schema offline), as I haven't got much hair left to
> pull out.
>
> Thanks in advance for any help on this.
>
> --
> Paul Hartland
> paul.hartland at googlemail.com
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



-- 
Gary Kjos
garykjos at gmail.com




More information about the AccessD mailing list