I'm running into an error and I cannot figure out what's wrong with the code. It happens when I try to create an object (objbl = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.4.0")).
Am I missing anything?
Try
objbl = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.4.0") // error happens on this line.
objbl.ConnectionString = ReadVariables("ConnectionString")
Console.WriteLine(objbl.connectionstring.ToString)
objbl.ErrorLogFile = workingdirectory & "\error.log"
objbl.TempFilePath = workingdirectory & "" 'workingdirectory
objbl.CheckConstraints = True
objbl.KeepIdentity = False
objbl.Transaction = True
'objbl()
Catch ex As System.Exception
Console.WriteLine("Error initializing SQL Bulk load object." & Chr(13) & Chr(10) & ex.ToString)
WritetxtToLog("Error initializing SQL Bulk load object." & Chr(13) & Chr(10) & ex.ToString, 1)
Exit Sub
End Try
Here's exception error:
System.Exception was caught Message="Cannot create ActiveX component." Source="Microsoft.VisualBasic" StackTrace: at Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName) at XMLshredapp.XMLShredApp.InitBulkLoad() in C:\ShredApp\XMLshredapp\XMLShredApp.vb:line 460 InnerException: