views:

152

answers:

2

Hi,

I am getting the following error: Invalid authorization specification

I've narrowed down the error to my connection string. I have verified the server name, database, user & password are correct. Here is the string:

"Provider=SQLOLEDB;Server=xxxxx.db.12345.hostedresource.com;Database=foo;UID=fooUser;PWD=fooPW"

The SQL server is hosted on Godaddy so I don't have access to its settings.

Please help, I've scoured the internet for a solution!

A: 

You did not specify what version of SQL server.

See this site for all the allowed connection strings - you will need to look at your version under the OLE DB driver.

Oded
It is SQL Server 9.0.4053
Scott
That appears to be SQL Server 2005
Scott
Thank you for the link. I compared my connection string to their examples. The only item I was missing was Trusted_Connection=False; which I added. Unfortunately it did not change the result. I am still getting the same error.
Scott
@Scott - can you connect to the server from SSMS? Where have you specified the connection string?
Oded
Yes, I can use SSMS to connect using the same credentials. The connection string is specified in the code, I don't know what you mean by this latter question.
Scott
@Scott - config file? What section? Directly in the code?
Oded
@Scott - try creating a file DSN with these credentials (control panel -> Admin Tools -> Data Sources (ODBC)) and test it. Examine it and convert to a connection string.
Oded
Try swapping from `SQLOLEDB` for the Native Provider by using `Provider=SQLNCLI10` or `Provider=SQLNCLI`
Alex K.
A: 

try with:

Provider=SQLOLEDB.1;Initial Catalog=fooDB;Data Source=xxxxx.db.12345.hostedresource.com;User ID=fooUser;Password=fooPW;Persist Security Info=True

Eduardo Molteni