Home All Groups Group Topic Archive Search About

UPDATE Field Database via xml - problem

Author
27 Jun 2006 1:35 PM
Ina
Good morning,

I have this code vbscript code for updata a xml file in to a database.
(sample) . I need to update a xml from a database1 to another
database2. As the results from the database1 generally changes a every
week, I need to export all the data to database2. I would like to
update this database3.


' VBScript source code


set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.3.0")


objBL.ConnectionString =
"provider=SQLOLEDB.1;datasource=localhost;database=MyDatabase;integrated

security=SSPI"


objBulkLoad.IgnoreDuplicateKeys = True
objBulkLoad.KeepIdentity = False
objBulkLoad.KeepNulls = True
objBulkLoad.ForceTableLock = True
objBulkLoad.SchemaGen = True
objBulkLoad.SGUseID = True
objBulkLoad.SGDropTables = True


objBL.ErrorLogFile = "c:\error.log"
objBL.Execute "customersmapping.xml", "customers.xml"
Set objBL = Nothing


and I update this xml file and all is ok


<?xml version="1.0" encoding="utf-8" ?>
<ROOT xmlns="custommers.xsd">
        <Customers>
                <CustomerId>1111</CustomerId>
                <CompanyName>Sean Chai</CompanyName>
                <City>NY</City>
        </Customers>
        <Customers>
                <CustomerId>1112</CustomerId>
                <CompanyName>Tom Johnston</CompanyName>
                <City>LA</City>
        </Customers>
        <Customers>
                <CustomerId>1113</CustomerId>
                <CompanyName>Institute of Art</CompanyName>
        </Customers>
        <Customers>
                <CustomerId>1156</CustomerId>
                <CompanyName>School</CompanyName>
        </Customers>
        <Customers>
                <CustomerId>189</CustomerId>
                <CompanyName>TOTO</CompanyName>
        </Customers>
</ROOT>


Now i would like to upload this file


<?xml version="1.0" encoding="utf-8" ?>
<ROOT xmlns="custommers.xsd">
        <Customers>
                <CustomerId>1111</CustomerId>
                <CompanyName>Sean Chai</CompanyName>
                <City>NY</City>
        </Customers>
        <Customers>
                <CustomerId>1112</CustomerId>
                <CompanyName>Tom Johnston</CompanyName>
                <City>LA</City>
        </Customers>
        <Customers>
                <CustomerId>1113</CustomerId>
                <CompanyName>Institute of Art</CompanyName>
        </Customers>
        <Customers>
                <CustomerId>1156</CustomerId>
                <CompanyName>School</CompanyName>
        </Customers>
        <Customers>
                <CustomerId>189</CustomerId>
                <CompanyName>Laria</CompanyName>
        </Customers>
<Customers>
                <CustomerId>156</CustomerId>
                <CompanyName>Jonathan</CompanyName>
                        <City>NY</City>


        </Customers>


</ROOT>


and I cannot do it! because it doesn't take on consideration the
changes on this file... How can I update this the changes into my
database3.


Any suggestion.


Ina

AddThis Social Bookmark Button