How to create a trusted SQL Server connection?

Posted on 2007-10-05
Last Modified: 2012-05-05
Hello All...
I have a clean install of Windows Server 2003, SP2, whose IP address is  It is not configured for DNS or DHCP as the router does that.  The PCs are windows XP Pro and are workgroup not domain
On the Server 2k3, is a new install of SQL Server 2000, SP3.  The SQL server has a database called PMCustomers.
I created an excel form (with the help of a lot of you guys&gals...THANKS!!), that at rpresent resides on the Server 2k3 and works great!
I now need to put the form on the PCs and be able to connect to the database.   I have changed the connection to the following code snippet:
' Create a connection object.
Dim cnPMCustomers As ADODB.Connection
Set cnPMCustomers = New ADODB.Connection

' Provide the connection string.
Dim strConn As String

'Use the SQL Server OLE DB Provider.

'Connect to the PMCustomers database on the local server.
'strConn = strConn & "DATA SOURCE=(local);INITIAL CATALOG=PMCustomers;"
strConn = strConn & "Data Source=,1433;Network Library=DBMSSOCN;INITIAL CATALOG=PMCustomers;"

'Use an integrated login.
strConn = strConn & " INTEGRATED SECURITY=sspi;"

'Now open the connection.
cnPMCustomers.Open strConn

The line of code that is commented out, 'strConn = strConn & "DATA SOURCE=(local);INITIAL CATALOG=PMCustomers;"; works great on the server .

When I try to connect to the database from a PC, I get this message

Run-time error '-2147467259 (800004005)':
Login failed for user '(null)'.  Reason: not associated with a trusted SQL Server connection

Can someone help me get the connection fixed...Please.

Question by:2addietoo
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    is the windows account - which you are logged on when running that code in excel - defined in the sql server -> security -> logins ?
    if not, the message is normal / expected

    Author Comment

    There has not been anything defined in the SQL Server...Can you help me configure this connection?

    The excel code is on a pc running XP Pro, sp2 and this machine's IP address is


    Author Comment

                        Data Source=,1433
    the sql server or the pc?

    Accepted Solution

    I figured out the problem on my own...
    I am requesting the points be returned and close the question

    Expert Comment


    The experts exchange's objective was share solutions. Not only to receive.

    Can you let all know what  ' I figured out the problem on my own...'

    shall be helpful

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
    Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
    Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
    Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now