SQLXMLBulkLoad:捕获了COMExecption,错误连接到数据源

时间:2012-10-17 16:32:39

标签: sql xml vb.net bulk-load

尝试执行SQLXMLBulkLoad时遇到此错误。这是对象的配置:

Public Shared objbl As New SQLXMLBULKLOADLib.SQLXMLBulkLoad4
objbl.ConnectionString = ReadVariables("Data Source=localhost;Initial Catalog=db1;Integrated Security=True")
objbl.ErrorLogFile = workingdirectory & "\error.log"
objbl.TempFilePath = workingdirectory
objbl.CheckConstraints = True
objbl.KeepIdentity = False
objbl.Transaction = True
objbl.FireTriggers = True
objbl.Execute(workingdirectory & "\xsdtempfile.xsd", fname)

源和目的地都在locahost上。

我没有看到我的连接字符串出了什么问题。

错误发生在这一行:

objbl.Execute(workingdirectory & "\xsdtempfile.xsd", fname)

任何人都可以帮我一把吗?

1 个答案:

答案 0 :(得分:0)

objbl.ConnectionString = "Provider=sqloledb;server=localhost;database=db1;integrated security=SSPI"

或试试这个

objbl.ConnectionString = "Provider=sqloledb;server=localhost;database=db1;user id=User;password=Password;persist security info=True;Connect Timeout=30"