How to create a trusted SQL Server connection?
Posted on 2007-10-05
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.
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.