Question : SQLNCLI for linked server returned message "Invalid authorization specification"

Thank you for looking at my question,

Scenario: The organisation for which I work has recently split into two discrete companies (Company A and Company B). I built a number of VB applications that interrogate / manipulate a SQL Server (Enterprise Manager) database running on SBS 2003.

The two companies have some common functions so I copied the Company A database to Company B's new SQL Server 2005 instance which is running on a new SBS 2003 server.

Have set up the relevant Company B users and ensured that they can see the Company B database via ODBC connection.

I ran one of the vb applications (compiled on my pc in Company A) on a pc in Company B and at the first point it should communicate with a database the thing crashed with the following error

Run Time Error '-21472179100 (80040e14)':
[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB provider "SQLNCLI" for linked server "COMPANY_A_SERVER" returned message "Invalid authorization specification"

My code doesn't make any reference to the Company A server, so where does the .exe file pick that reference up?

I have attached the connection string I use in the code.

How can I make the executable run on Company B system?

Thank you

Code Snippet:
1:
2:
3:
Set connSupplier = New Connection
    connSupplier.CursorLocation = adUseClient
    connSupplier.Open "PROVIDER=MSDASQL;dsn=ODBCName;uid=UserName;pwd=password;database=databasename;"

Answer : SQLNCLI for linked server returned message "Invalid authorization specification"

When you test the ODBC for user on company B - do you have a way to Verify that the ODBC connects to the correct server?

Have you tried turning off the database for company A to ensure that the connection is going to the right place.
It is hard to fathom that you would connect to A when you have set everything to B unless there is something about the SQL Server that makes it think it is company A.  Either way, I would have expected that you would have connected to company A anyway since users were replicated.  I know that none of this is an answer or suggestion, but something in the milk is just not quite clean.
Random Solutions  
 
programming4us programming4us