B
Bill Murphy
I have Developer XP Office and am attempting to use the TestConnection sub
from the Access 2002 Enterprise Developer's Handbook to programatically
create an ADO connection to my COMPAQ SQL 2000 server. User COMPAQ\bmurphy
is set up for Windows Authentication. The following code produces the error
"Login failed for user 'Bmurphy'. Reason: Not associated with a trusted SQL
Server connection." The error message displays when the Open statement is
executed.
Bmurphy is set up as a user in Windows 2000 on the same PC (which is also
named COMPAQ) with Windows password thomas. The code is:
Dim cnn As ADODB.Connection
Dim l As Long
' Create a new Connection object
Set cnn = New ADODB.Connection
With cnn
' Set the connection string and open the
' connection
.ConnectionString = _
"Provider=SQLOLEDB;SERVER=COMPAQ;UID=Bmurphy;PWD=thomas"
.Open
' List out all the connection properties
For l = 0 To .Properties.Count - 1
With .Properties.Item(l)
Debug.Print .Name, .Value
End With
Next
' Drop the connection
.Close
End With
I would appeciate any thoughts on this.
Bill
from the Access 2002 Enterprise Developer's Handbook to programatically
create an ADO connection to my COMPAQ SQL 2000 server. User COMPAQ\bmurphy
is set up for Windows Authentication. The following code produces the error
"Login failed for user 'Bmurphy'. Reason: Not associated with a trusted SQL
Server connection." The error message displays when the Open statement is
executed.
Bmurphy is set up as a user in Windows 2000 on the same PC (which is also
named COMPAQ) with Windows password thomas. The code is:
Dim cnn As ADODB.Connection
Dim l As Long
' Create a new Connection object
Set cnn = New ADODB.Connection
With cnn
' Set the connection string and open the
' connection
.ConnectionString = _
"Provider=SQLOLEDB;SERVER=COMPAQ;UID=Bmurphy;PWD=thomas"
.Open
' List out all the connection properties
For l = 0 To .Properties.Count - 1
With .Properties.Item(l)
Debug.Print .Name, .Value
End With
Next
' Drop the connection
.Close
End With
I would appeciate any thoughts on this.
Bill