Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Error connecting to data source

Author  Topic 

nemike
Starting Member

3 Posts

Posted - 2006-01-24 : 19:43:58
I am trying to import an XML into a database I created in MS SQL 2005 via SQLXMLBulkLoad4. I used the .NET SDK toolkit program xsd.exe to create a XML schema for my XML file and then I pieced together code from some examples I found online in VS 2005's VB.
In the following code I did provide a user I created in SQL Manager and it's password. I also used both the actual hostname and I also tried localhost (the VB is running on the same machine as MS SQL 2005)

Dim objXBL As New SQLXMLBULKLOADLib.SQLXMLBulkLoad4
objXBL.ConnectionString = "PROVIDER=SQLOLEDB;SERVER=hostname;UID=username;PWD=password;DATABASE=database;"
objXBL.ErrorLogFile = "C:\database\database.errlog"
objXBL.KeepIdentity = False
objXBL.Execute("C:\database\collection.xsd", "C:\database\collection.xml")
objXBL = Nothing

I get a COMException was unhandled dialog, the view details says "Error connecting to the data source"

I sure hope someone out there can help me, I've been at it for several days and haven't gotten anywhere.

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-02-06 : 04:22:40
for your reference --> http://www.connectionstrings.com/

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -