hi experts,
I'm a DBA, trying to help a web developer connect to a SQL Server (2000) db using ASP 3 (not .net)
Error: "Login failed for user.... Not associated with a trusted connection."
NOTE: Server is set for 'Windows only' authentication
The SQL Server server is also the web server.
This is the asp code: (Server and database are same name "sonyBMG")
Do you see any defects in the connection string?
Thanks. John
<%
'sample SQL database connection syntax for ASP and SQL Server
Dim oConn, oRs
Dim qry, connectstr
Dim db_name, db_username, db_userpassword
Dim db_server
db_server = "sonyBMG"
db_name = "sonyBMG"
db_username = "OurDomainName\TheUserName"
db_userpassword = "SE.236.210"
fieldname="controlNum"
tablename="tblMain"
connectstr = "Driver={SQL Server}; SERVER=" & db_server & "; DATABASE=" & db_name &"; UID=" & db_username & "; PWD="& db_userpassword
response.write connectstr & "=connectionstr<br>"
Set oConn = server.CreateObject("ADODB.Connection")
oConn.Open connectstr
qry = "SELECT * FROM " & tablename
Set oRS = oConn.Execute(qry)
do until oRS.EOF
response.write ucase(fieldname) & ": " & oRs.fields(fieldname)
oRS.movenext
loop
oRS.close
set oRS = nothing
set oConn = nothing
%>
NOTE:
I'm a DBA, trying to help a web developer connect to a SQL Server (2000) db using ASP 3 (not .net)
Error: "Login failed for user.... Not associated with a trusted connection."
NOTE: Server is set for 'Windows only' authentication
The SQL Server server is also the web server.
This is the asp code: (Server and database are same name "sonyBMG")
Do you see any defects in the connection string?
Thanks. John
<%
'sample SQL database connection syntax for ASP and SQL Server
Dim oConn, oRs
Dim qry, connectstr
Dim db_name, db_username, db_userpassword
Dim db_server
db_server = "sonyBMG"
db_name = "sonyBMG"
db_username = "OurDomainName\TheUserName"
db_userpassword = "SE.236.210"
fieldname="controlNum"
tablename="tblMain"
connectstr = "Driver={SQL Server}; SERVER=" & db_server & "; DATABASE=" & db_name &"; UID=" & db_username & "; PWD="& db_userpassword
response.write connectstr & "=connectionstr<br>"
Set oConn = server.CreateObject("ADODB.Connection")
oConn.Open connectstr
qry = "SELECT * FROM " & tablename
Set oRS = oConn.Execute(qry)
do until oRS.EOF
response.write ucase(fieldname) & ": " & oRs.fields(fieldname)
oRS.movenext
loop
oRS.close
set oRS = nothing
set oConn = nothing
%>
NOTE: