[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to create a trusted SQL Server connection?

Posted on 2007-10-05
5
Medium Priority
?
775 Views
Last Modified: 2012-05-05
Hello All...
I have a clean install of Windows Server 2003, SP2, whose IP address is 192.168.1.2.  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.
strConn = "PROVIDER=SQLOLEDB;"

'Connect to the PMCustomers database on the local server.
'strConn = strConn & "DATA SOURCE=(local);INITIAL CATALOG=PMCustomers;"
strConn = strConn & "Data Source=192.168.1.2,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.

Addie
0
Comment
Question by:2addietoo
  • 3
5 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20025399
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
0
 

Author Comment

by:2addietoo
ID: 20025512
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 192.168.1.100

Thanks...Addie
0
 

Author Comment

by:2addietoo
ID: 20025518
Also...is
                    Data Source=192.168.1.2,1433
the sql server or the pc?
addie
0
 

Accepted Solution

by:
2addietoo earned 0 total points
ID: 20062143
I figured out the problem on my own...
I am requesting the points be returned and close the question
0
 

Expert Comment

by:Gururagguru
ID: 21531748
2addietoo:

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
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

872 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