Davidloc
asked on
Error SQL server does not exist or no login permissions error when running VBA function
I am running this function from WIN7 using Access 2010 to an MSWIN 2008 R2 server hosting MSSQL 2008 R2 and receive the above message. I can connect using SQLCMD using my user ID and server name with no problem.
Function
Dim CompassConnection As Variant
Set CompassConnection = CreateObject("ADODB.CONNEC TION")
CompassConnection.Connecti onString = "ODBC;Description=Compass; DRIVER=SQL Server;SERVER=OTTCOMPASS\I TNETCOMP1; APP=Micros oft Open Database Connectivity;WSID=OTTWS100 ;DATABASE= Compass;Tr usted_Conn ection=Yes ;"
If CompassConnection.Open Then
MsgBox "The connection has been established."
End If
CompassConnection.Close
Set CompassConnection = Nothing
END FUNCTION
Does anyone have any ideas ?
Thanks for any help you can provide.
Function
Dim CompassConnection As Variant
Set CompassConnection = CreateObject("ADODB.CONNEC
CompassConnection.Connecti
If CompassConnection.Open Then
MsgBox "The connection has been established."
End If
CompassConnection.Close
Set CompassConnection = Nothing
END FUNCTION
Does anyone have any ideas ?
Thanks for any help you can provide.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.