PDA

View Full Version : Solved: MS SQL OLEDB struggling



doubtfire
08-28-2009, 01:21 PM
I have used a Connection to the MS-SQL 2005 under Excel 2003 and run under the Server "Server001" with the instance "Instance001", and
it does not matter I use Uid/User ID or Pwd/Password I get the same error
"Login failed for user User001". Also, I have tried to have user as "User001" and "Server001\User001", they yield the same error. Any ideas !?
Also, I logged in the server (where I run the Excel) as "Server001\User001" ( dbowner of "AdventureWorks"). This is the partial code ...Thanks !:banghead:

Dim Conn As ADODB.Connection
Const ConnectionString As String = _
"Provider=SQLOLEDB.1;" & _
"Server=Server001\Instance001;" & _
"Database=AdventureWorks;" & _
"Uid=User001;" & _
"Pwd=pass001"

On Error GoTo ShowError

Set Conn = New ADODB.Connection

Call Conn.Open(ConnectionString)

ShowError:
If (Err.Number <>0) Then Debug.Print Err.Description

Bob Phillips
08-28-2009, 01:46 PM
What version of MDAC do you have?

doubtfire
08-28-2009, 02:06 PM
MDAC 2.8, Sir! gracias!

Bob Phillips
08-28-2009, 04:08 PM
So are you solved now?

doubtfire
08-28-2009, 06:18 PM
Yes, thanks.