I use the below code for connection string to SQL server, but can't connect and have error message display on the SQL error log.
<%
Dim conn,StrConn
set conn = Server.CreateObject("ADODB.Connection")
StrConn = "driver={SQL server};server=servername;database=pubs;uid='myusername';pwd='nopassword'"
conn.Open(StrConn)
.
.
conn.close
%>
Error message:
Login failed for user ''myusername''. Reason: Not associated with a trusted SQL Server connection.
How to solve the problem?