Showing posts with label denied. Show all posts
Showing posts with label denied. Show all posts

Tuesday, March 27, 2012

A different question about SQL Server Access Denied

I have 2 development servers, both of which I need to use to run an ASP.NET app. The app connects to an external SQL Server with SQL Server authentication only. One of my servers connects properly, but the same exact app running on the second server generates the dreaded SQL Server Access Denied message. A traditional .asp file running on the second server does connect successfully to the database, so I have deduced that the problem is related either to the ASPNET account on the second server, or else to the structure of the server itself or IIS.

I have verified on both machines that IIS uses the ASPNET account for anonymous access. The only difference I can find is that the working server is using NTFS (and the VS_Developers account has full permission on my application's directory), while the problem server is using FAT. Does anyone know if it the FAT file system could be my problem? If so, should I convert to NTFS, or is there another solution? What else could I look at on the problem server? Any help would be greatly appreciated. Thanks.If you are using SQL Server authentication then using IIS anonymous accounts and ASP.Net accounts are not involved in the authentication. What is the exact message that appears? Login failed for user [...] ?

If you are using SQL server with SQL server authentication then in the connection string you should be providing the UID and Password of a SQL Server Login and there should be no "integrated security" clause in the connection string.|||Thanks for the reply. The error message is: "SQL Server does not exist or access is denied". There is no login failure error occurring.

Here is my connection string:
"Data Source=mySQLIPhere,1433;Network Library=DBMSSOCN;Initial Catalog=myDBName;User ID=mySQLUser;Password=mySQLPw;"

As I mentioned, this connection string works fine from one of the 2 development servers as well as from the production web server, so I don't think the connection string is the problem.|||Seems ok to me; if you are willing to do some experiments try these in order.

Verify that you can access mySQLIPhere machine from the machine causing the problem. e.g. by trying to open \\mySQLIPhere or by pinging.

Use query analyzer to connect to SQL Server from the machine causing problem. In "connect to SQL Server" dialog box provide mySQLIPhere as Sql Server name, select Sql Sever Auth, loginname and password. If this works you may experiment rewriting your connection string bit by bit e.g.:
"Data Source=mySQLIPhere; User ID=mySQLUser; Password=mySQLPw;"
"Data Source=mySQLIPhere,1433; User ID=mySQLUser; Password=mySQLPw;"
"Data Source=mySQLIPhere;Initial Catalog=myDBName; User ID=mySQLUser; Password=mySQLPw;"

It is most probably the SQL Server not exist (not found) part that looks true, rather than the access denied part.

Monday, February 13, 2012

404 Access Denied

Any clues?
404 Access Denied
... omitted code...
m_credentials = New System.Net.NetworkCredential(Common.SRSUserName,
Common.SRSPassword, Common.SRSDomain)
_rs.Credentials = m_credentials
end sub
... omitted code...
Dim items() As CatalogItem
_rs.Url = Common.SRSServerName
items = _rs.ListChildren("/", True)
Line 208:"ildren",
RequestNamespace:="http://schemas.microsoft.com/sqlserver/2003/12/reporting/repo
rtingservices",
ResponseNamespace:="http://schemas.microsoft.com/sqlserver/2003/12/reporting/rep
ortingservices", Use:=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
Line 209: Public Function ListChildren(ByVal Item As String, ByVal
Recursive As Boolean) As
<System.Xml.Serialization.XmlArrayAttribute("CatalogItems")> CatalogItem()
Line 210: Dim results() As Object = Me.Invoke("ListChildren", New
Object() {Item, Recursive})
Line 211: Return CType(results(0),CatalogItem())
Line 212: End FunctionIt was my web.config
I had mis-read that I should add to <identity impersonate="true"/> to the
authorization section, but "after" was where it belonged.
JeffP...
"JDP@.Work" <JPGMTNoSpam@.sbcglobal.net> wrote in message
news:eUBCRPTwEHA.536@.TK2MSFTNGP11.phx.gbl...
> Any clues?
> 404 Access Denied
> ... omitted code...
> m_credentials = New System.Net.NetworkCredential(Common.SRSUserName,
> Common.SRSPassword, Common.SRSDomain)
> _rs.Credentials = m_credentials
> end sub
> ... omitted code...
> Dim items() As CatalogItem
> _rs.Url = Common.SRSServerName
> items = _rs.ListChildren("/", True)
>
> Line 208:"ildren",
>
RequestNamespace:="http://schemas.microsoft.com/sqlserver/2003/12/reporting/repo
> rtingservices",
>
ResponseNamespace:="http://schemas.microsoft.com/sqlserver/2003/12/reporting/rep
> ortingservices", Use:=System.Web.Services.Description.SoapBindingUse.Literal,
> ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
> Line 209: Public Function ListChildren(ByVal Item As String, ByVal
> Recursive As Boolean) As
> <System.Xml.Serialization.XmlArrayAttribute("CatalogItems")> CatalogItem()
> Line 210: Dim results() As Object = Me.Invoke("ListChildren", New
> Object() {Item, Recursive})
> Line 211: Return CType(results(0),CatalogItem())
> Line 212: End Function
>

401 authorization denied error for web service proxy

all-
When I have a SQLXML 3.0 virtual directory set up on the same web server as the one that my application is in on my local machine, I can run the application. When I move the web reference (and the web service) to a different server, I can access the
application on my machine with http://localhost but not http://<machinename>.
I have tried setting various properties from the System.Web.Services library in addition to credentials. Here are the the things I have tried:
proxy.UnsafeAuthenticatedConnectionSharing = true;
proxy.Credentials = CredentialCache.DefaultCredentials;
proxy.PreAuthenticate = true;
Maybe the problem is with IIS, but the username does seem to be passed in correctly when it is localhost.
to recap
SAME BOX LOCAL WEB, REMOTE SQLXML BOTH REMOTE
http://localhost YES YES NO
http://<machinename> YES NO NO
After further troubleshooting I can say with some confidence that this is a problem with server-to-server communication.
I have found KB articles on ServerXMLHTTP and how to pass default credentials from server to server, but no examples in .NET.
I also tried every syntax of proxycfg that I could think of, all the way down to
proxycfg -d
Now all requests bypass the proxy server and I still can't pass default credentials.
Any help would be greatly appreciated.