2 Replies - 95 Views - Last Post: 28 July 2014 - 12:36 PM

#1 ebolisa  Icon User is online

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 151
  • Joined: 22-September 09

Batch script error

Posted 28 July 2014 - 12:07 PM

Hi,
The following script creates a sql table and uploads xml data to it.
The table is created ok but the scripts halts at line 16 (Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")) with the error msg: ActiveX component cannot create the object – SQLXMLBulkLoad – code 800A01AD.
I run the script as admin with no avail.
The code is taken from this web: http://davidghedini....sql-server.html
Any help is appreciated.
Best rds.

SQLEXPRESS 2008

Const DB_CONNECT_STRING = "provider=SQLOLEDB.1;data source=BOMBO\SQLEXPRESS;database=MyDB;uid=sa;pwd=pass"
 Set myConn = CreateObject("ADODB.Connection")
 Set myCommand = CreateObject("ADODB.Command" )
 myConn.Open DB_CONNECT_STRING
 Set myCommand.ActiveConnection = myConn
 myCommand.CommandText = "CREATE TABLE Product (ean varchar(150),referencia varchar(100),marca varchar(100),descripcion varchar(255),sexo varchar(15),stock int, precio decimal(4,2),categoria varchar(100),edad varchar(15),pvprecom decimal(4,2))"
 myCommand.Execute
 myConn.Close

 sDay = Day(Now())
 If Len(sDay) = 1 Then sDay = "0" & Day(Now())
 sMonth = Month(Now())
 If Len(sMonth) = 1 Then sMonth = "0" & Month(Now())
 sYear = Year(Now())
 sDate = sYear & sMonth & sDay 
 Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
 objBL.ConnectionString = "provider=SQLOLEDB.1;data source=BOMBO\SQLEXPRESS;database=MyDb;uid=sa;pwd=pass"
 objBL.ErrorLogFile = "C:\xml\error.log"
 objBL.Execute "C:\xml\tarifasMap.xml", "C:\xml\tarifas"+"-"+sDate+".xml"
 Set objBL = Nothing


This post has been edited by ebolisa: 28 July 2014 - 12:14 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Batch script error

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4337
  • View blog
  • Posts: 12,137
  • Joined: 18-April 07

Re: Batch script error

Posted 28 July 2014 - 12:18 PM

Did you actually download and install SQLXML? Oh and I am not sure if Express is going to have everything you need for that. Sounds like you have yet to install and meet the system requirements for running that code.

You can try SQLXML 3.0 and see if perhaps that works... http://www.microsoft...s.aspx?id=11811

This post has been edited by Martyr2: 28 July 2014 - 12:19 PM

Was This Post Helpful? 0
  • +
  • -

#3 ebolisa  Icon User is online

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 151
  • Joined: 22-September 09

Re: Batch script error

Posted 28 July 2014 - 12:36 PM

Hi,
Thanks for replying.
Actually I installed SqlXml 4.0 Service Pack 1 (SP1) with no avail.
I'm running win7 pro.

--SOLVED by changing line 16 to: Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.4.0")

This post has been edited by ebolisa: 28 July 2014 - 12:50 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1