October 31, 2004 at 12:08 am
hey all
i have a sqlserver in my desktop and the connection to it is through windows authentication. when i access the database(sqlserver) from .net windows application i have no pblms but when i access the sqlserver from asp.net file i get login error.
what is the remedy for this.thanx
Rajiv.
November 1, 2004 at 7:20 am
Here is a sample connection string and query, to our SQL Server. It works great.
I hope it helps.
<%
Response.Expires = 0
' Set variables, build connection string and open connection
Dim objConn, objRS, strQuery, strConnection
Set objConn = Server.CreateObject("ADODB.Connection")
strConnection = "DSN=[data source name];Database=[database name];"
strConnection = strConnection & "UID=;PWD=[password]"
objConn.Open strConnection
' Build Query String
strQuery = "SELECT [fields]FROM
"
strQuery = strQuery & "[WHERE clause]"
strQuery = strQuery & "[Order By clause]"
' Set Record Set Object
Set objRS = objConn.Execute(strQuery)
%>
November 1, 2004 at 8:59 am
Post a sample of the connection string that is being used in the ASP.NET page/application...
November 1, 2004 at 9:09 am
Using your regular ASP connection as an example:
Set objConn = Server.CreateObject("ADODB.Connection")
strConnection = "DSN=[data source name];Database=[database name];"
strConnection = strConnection & "UID=;PWD=[password]"
The "UID" and "PWD" in this connection string need to be a SQL login - NOT - a Windows and/or active directory user account.
For example, using SQL Enterprise Manager:
1.) Select a registered Server->Security->Logins
2.) Create a new login giving it a name and password using "SQL Server authentication"
3.) Make sure this new login has appropriate access permissions on needed databases/views/SP's etc.
Use this login "UID" and "PWD" in your connection string in ASP.NET...give it a try
November 2, 2004 at 10:28 am
hey guys
thanx all for ur efforts and help. i reinstalled sqlserver. the pblm got solved.....i dont know how?
but i think thats microsoft probably
Rajiv.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy