Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot initialize the data source for linked server

Status
Not open for further replies.

steph2004

Programmer
Apr 1, 2004
7
CA
Hi,

I have this error when I run a stored procedure calling a MSSQL linked server :

System.Data.SqlClient.SqlException: Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "linkedServerABC"

The problem is that when I run the exact stored proc in SQL Server via the query editor it works well.

So why ASP.Net on the same server can't execute this stored proc?

Any idea?

Thanks

Stephane
 
Of course I did, Google first, forums next!

I saw these results but it's not working for me since I'm not using ODBC. Here's my connection string (C#) :

connection = new SqlConnection();
connection.ConnectionString = "Server=1.2.3.4;Database=testDB;User ID=DBweb;Password=1234;Trusted_Connection=False";
connection.Open();

I checked the security and everything seems fine. I don't know what else to check and it bugs me big time since it works well in the query editor.

Thanks

Stephane
 
i believe the connection for the linked server uses odbc. change the sp to return the same columns from a temporary table. if no error occurs the problem is the linked server.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top