Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to XML - Using SQLXMLBilkLoad for Import

Status
Not open for further replies.

tc3596

Technical User
Mar 16, 2001
283
In trying to use SQLXMLBulkLoad, it requires a schema and an XML file. The person sending me the data for import only gives me the one file shown below. Should I be asking for a separate schema file from him, or is SQLXMLBulkLoad going to grab the schema from the location specified in the XML file? If the latter is correct, do I just use the same file for both the schema and XML file as listed here....

Set objAccess = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objAccess.ConnectionString = "PROVIDER=SQLOLEDB;SERVER=dysa107365-02;" & _
"DATABASE=demodata;INTEGRATED SECURITY=sspi;"
objAccess.Execute "C:\Agile.xml", "C:\Agile.xml",
Set objAccess = Nothing

Here is a snippet of my XML file....

<?xml version="1.0" encoding="UTF-8" ?>
- <AgileData xmlns=" xmlns:xsi=" xmlns:xsd=" xsi:schemaLocation=" - <ChangeOrders uniqueId="6000:6333487">
- <CoverPage>
<Number>C00019</Number>
<Status>CM Notify</Status>
<ChangeType>Engineering Change</ChangeType>
<ChangeCategory>Routine</ChangeCategory>
<DescriptionOfChange>Macola testing - updated change</DescriptionOfChange>
<ReasonForChange>Macola testing</ReasonForChange>
<ReasonCode>10 - PCB Change</ReasonCode>
<Workflow>EC_ROUTINE_WORKFLOW</Workflow>
<Originator>Stafford, Roy (rstafford)</Originator>
<DateOriginated>2008-06-25T18:10:12Z</DateOriginated>
<DateReleased>2008-06-25T18:21:34Z</DateReleased>
</CoverPage>
.....................

Thank you for your input.
 
>objAccess.Execute "C:\Agile.xml", "C:\Agile.xml",
Apart from a typo of comma at the end, I don't think that will do: meaning I don't think it would fetch the schema according to the xsi:schemaLocation attribute.

However, you can try using that data like this.
[tt] objAccess.Execute "[ignore][/ignore]", "C:\Agile.xml"[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top