Showing posts with label http. Show all posts
Showing posts with label http. Show all posts

Tuesday, March 20, 2012

permissions issue with http driven report in web iframe

Hi there,

I need to understand why I am getting the following error when I run my deployed (remote) report embedded in an iframe within a page of my web application.

error:
An

error has occurred during report processing. (rsProcessingAborted)
Query

execution failed for data set 'cnMOOR'. (rsErrorExecutingCommand)For

more information about this error navigate to the report server on the local

server machine, or enable remote error

This happens when I fire the following code from a commandbutton:
AppSettingsReader cfgApp = new AppSettingsReader();

string prefix = Convert.ToString(cfgApp.GetValue("reporturlprefix", typeof(System.String)));

string reporturl = prefix + "Client&rs:Command=Render&rs:Format=HTML4.0&rc:Parameters=False&supplierid=" + Session["supplierId"].ToString() + "&clientid=" + ddlClient.SelectedItem.Value + "&startdate=" + txtStartDate.Text + "&enddate=" + txtEndDate.Text + "&ownertype=1";

SpecificClient.Attributes.Add("src", reporturl);

SpecificClient is the ID of the Iframe

on the same page I created a link - which runs the report perfectly - no permission problems.
<a href="http://server2003msrs/reportserver?/moorreports/Client&rs:Command=Render&rs:Format=HTML4.0&rc:Parameters=False&supplierid=28&clientid=71&startdate=2007-01-01&enddate=2007-02-16&ownertype=1">Test</a>

I don't understand why these two controls are behaving differently.

I'd appreciate some guidance with this as the deadline looms...

Helen


  • Hi there,

    something that I didn't mention - this error only happened when I changed the connection string properties. Previously both controls had worked fine.

    I eventually fixed it by creating a new report whilst pointing at the new database.

    suddenly all of them worked as before.

    weird, but that's what solved the issue.

    regards Helen

  • permissions issue with http driven report in web iframe

    Hi there,

    I need to understand why I am getting the following error when I run my deployed (remote) report embedded in an iframe within a page of my web application.

    error:
    An

    error has occurred during report processing. (rsProcessingAborted)
    Query

    execution failed for data set 'cnMOOR'. (rsErrorExecutingCommand)For

    more information about this error navigate to the report server on the local

    server machine, or enable remote error

    This happens when I fire the following code from a commandbutton:
    AppSettingsReader cfgApp = new AppSettingsReader();

    string prefix = Convert.ToString(cfgApp.GetValue("reporturlprefix", typeof(System.String)));

    string reporturl = prefix + "Client&rs:Command=Render&rs:Format=HTML4.0&rc:Parameters=False&supplierid=" + Session["supplierId"].ToString() + "&clientid=" + ddlClient.SelectedItem.Value + "&startdate=" + txtStartDate.Text + "&enddate=" + txtEndDate.Text + "&ownertype=1";

    SpecificClient.Attributes.Add("src", reporturl);

    SpecificClient is the ID of the Iframe

    on the same page I created a link - which runs the report perfectly - no permission problems.
    <a href="http://server2003msrs/reportserver?/moorreports/Client&rs:Command=Render&rs:Format=HTML4.0&rc:Parameters=False&supplierid=28&clientid=71&startdate=2007-01-01&enddate=2007-02-16&ownertype=1">Test</a>

    I don't understand why these two controls are behaving differently.

    I'd appreciate some guidance with this as the deadline looms...

    Helen


  • Hi there,

    something that I didn't mention - this error only happened when I changed the connection string properties. Previously both controls had worked fine.

    I eventually fixed it by creating a new report whilst pointing at the new database.

    suddenly all of them worked as before.

    weird, but that's what solved the issue.

    regards Helen

  • Permissions Issue Logging into Mgt Studio

    I am unable to log into SSRS from Mgt Studio and receive a permissions error when I go to http://ServerName/reportserver in IE. When loging into Mgt Studio I've entered the following for the server name:

    ServerName
    ServerName\Insance
    http://ServerName/reportserver

    The first two methods return an error "server cannot be found". The third allows me to login but when I click on "Home" I receive:

    TITLE: Microsoft SQL Server Management Studio

    Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)
    ADDITIONAL INFORMATION:

    The permissions granted to user 'mydomain\myAccount' are insufficient for performing this operation. (rsAccessDenied) (Report Services SOAP Proxy Source)
    The permissions granted to user 'mydomain\myAccount' are insufficient for performing this operation. (rsAccessDenied) (ReportingServicesLibrary)

    ******************************************
    I am a member of the dcom and power users group. Does anyone know what is causing this and how to resolve?

    thanks in advance,
    ScottSounds like you haven't set the correct permissions ;)
    Goto http://localhost/reports as a local-administrator then on root -> properties and add a new role for mydomain\myAccount..
    For testing you could add "Everyone" as a content-manager and then reduce the rights until they fit for your case..

    Monday, March 12, 2012

    Permissions

    I posted a problem with connecting programmatically last week.

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=590672&SiteID=1

    Nobody seemed to have any suggestions, however since then, I've mucked things up and recovered to the same problem and now I've mucked things up again in a different way. Also last week I didn't mention that I was running my connection through remote desktop. That apparently can be a problem although not the fix.

    I'm still getting the ServerVersion member status set to "'this.conn.ServerVersion' threw an exception of type 'System.InvalidOperationException' when I try to create a SqlConnection. I still don't understand why. But when I try to open the connection I now get the following exception

    "Cannot open user default database. Login failed.\r\nLogin failed for user 'myserver\\ASPNET'."

    which suggested permission problems. So using SQL Server Management Studio Express I opened my database and under properties selected "View server permissions" and the following message popped up.

    TITLE: Microsoft SQL Server Management Studio Express

    Cannot show requested dialog.


    ADDITIONAL INFORMATION:

    Could not load file or assembly 'file:///C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlManagerUi.dll' or one of its dependencies. The system cannot find the file specified. (mscorlib)

    There are no users listed under Permissions. I added guest permissions but it doesn't seem to make any difference. Since I'm running this under a web service, do I need to do something special?

    Help

    Cannot open user default database. Login failed.\r\nLogin failed for user 'myserver\\ASPNET'."

    this error is trying to tell you there is an issue with the user's default database. ensure whatever account you are using to access your sqlserver has atleast public permissions.

    In Mgmt. Studio/Object Explorer navigate to the Logins folder. Expand the folder and select the user you are attempting a client-side/ADO connection with. Select properties on the login and then select the "user mapping" tab. Check the public role for the user's assigned default database.

    |||

    Derek

    Thanks for replying. Although not new to programmatically using databases I'm new to using sql server and not being familiar with it's terminology leaves me scratching my head while I try and hunt down what the error messages mean.

    I've tried using both integrated security and adding my own user with a password. I know I'm probably missing something fundamental and thought maybe you had just given me the key. Unfortunately it doesn't appear to be the complete answer.

    |||if you dont care about how you connect, for simplication purposes use sql authentication in your client code. create the account in sql server assign it's default database and ensure the sql account has atleast public (read) permission to that database.|||

    Derek

    I don't care at the moment how I connect. I would just like to see it connect.

    I had already tried sql authentication before without success. After your response I tried again, messing with the connection string. No success.

    |||is sql authentication enabled?|||

    Derek

    In SQL Server Management under Logins I've added a user called pubsub, set his login to SQL Server authentication and set his password. Then under User Mappings I made sure that public, reader, writer were checked.

    In my application I used the following connection string,

    "Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\WebServicesDemo\\PubSub\\App_Data\\PubSubDB.mdf;Database=PubSubDB;User ID=pubsub;Password=pspwd; Integrated Security=False;User Instance=True"

    The connection error I get is

    Login failed for user 'pubsub'. The user is not associated with a trusted SQL Server connection.|||you can run this code

    USE [master]

    GO

    EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2

    GO

    or simply enable sql authentication via the GUI/Mgmt. Studio. and restart the server after making the change.

    |||

    Derek

    I found the place in the gui under Server properties where I was able to set Server authentication to SQL Server. I then restarted SQL Server. The response I now get from a connection attempt is

    Failed to generate a user instance of SQL Server. Only an integrated connection can generate a user instance. The connection will be closed.

    Another interesting piece to this puzzle. My test setup involves a web application that makes a call to a web service. For simplification I moved the code to open the database to the web application using Windows authentication. It worked. I took the same code back to my web service and it doesn't work. What does that suggest? I tried that again with the current setup and received the same error above.

    |||

    Sorry, I hit the submit button to soon. I also meant to tell you that when I set Integrated Security=true, the connection in the web application works. When I set Integrated Security=true in the web service I get the following error

    Unable to open the physical file \"C:\\WebServicesDemo\\PubSub\\App_Data\\PubSubDB.mdf\". Operating system error 5: \"5(Access is denied.)\".\r\nCould not attach file 'C:\\WebServicesDemo\\PubSub\\App_Data\\PubSubDB.mdf' as database 'PubSubDB'.

    |||

    Derek

    Some more information. I noticed that although I've supposedly enabled SQL Server authentication (mixed mode), the connection properties Authentication method still show Windows Authentication. I tried to issue your registry change from sqlcmd and received

    RegCreateKeyEx() returned error 5, 'Access is denied.'

    So I created the key and value manually. It didn't change the connection property Authentication method which still showed Windows Authentication.

    Everything I've try seems to work in the web application, but not in the Web Service. In the Web Service, I still received the "Unable to open the physical file" error.

    |||

    Derek

    If your still following this I solved my problem. Although I knew it wouldn't be an acceptable final answer I decided as another data point to set impersonation in the web service web.config file using my personal login information. That worked, which confirmed to me the problem definitely had to do with the permissions of the web service account (I don't alway trust error messages).

    So then I looked again at the account information to the database file itself. When I created the database using Visual Studio, VS put the database in the web services data directory and created a weird sqlexpress account (SQLServer2005MSSQLUser$WD49832$SQLEXPRESS (WD49832\SQLServer2005MSSQLUser$WD49832$SQLEXPRESS)) which I had just accepted managed VS's access to the database. Well I shouldn't trust MS to be so kind. I still don't know the purpose of that account but it obviously doesn't handle the application's access. Once I added the users group to the database file and gave them the necessary permissions it worked. I'm going to claim that there were just to many things I didn't understand in the beginning so I stepped into accepting bad assumptions. The upside I've learned more than I would had it been easy.

    Thanks for your company and help while I struggled through that one.

    |||your welcome and to be honest you taught me that "user instances" something I never use YET have to be used in conjunction with Integrated (windows) authentication. (which makes sense)

    Permissions

    I posted a problem with connecting programmatically last week.

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=590672&SiteID=1

    Nobody seemed to have any suggestions, however since then, I've mucked things up and recovered to the same problem and now I've mucked things up again in a different way. Also last week I didn't mention that I was running my connection through remote desktop. That apparently can be a problem although not the fix.

    I'm still getting the ServerVersion member status set to "'this.conn.ServerVersion' threw an exception of type 'System.InvalidOperationException' when I try to create a SqlConnection. I still don't understand why. But when I try to open the connection I now get the following exception

    "Cannot open user default database. Login failed.\r\nLogin failed for user 'myserver\\ASPNET'."

    which suggested permission problems. So using SQL Server Management Studio Express I opened my database and under properties selected "View server permissions" and the following message popped up.

    TITLE: Microsoft SQL Server Management Studio Express

    Cannot show requested dialog.


    ADDITIONAL INFORMATION:

    Could not load file or assembly 'file:///C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlManagerUi.dll' or one of its dependencies. The system cannot find the file specified. (mscorlib)

    There are no users listed under Permissions. I added guest permissions but it doesn't seem to make any difference. Since I'm running this under a web service, do I need to do something special?

    Help

    Cannot open user default database. Login failed.\r\nLogin failed for user 'myserver\\ASPNET'."

    this error is trying to tell you there is an issue with the user's default database. ensure whatever account you are using to access your sqlserver has atleast public permissions.

    In Mgmt. Studio/Object Explorer navigate to the Logins folder. Expand the folder and select the user you are attempting a client-side/ADO connection with. Select properties on the login and then select the "user mapping" tab. Check the public role for the user's assigned default database.

    |||

    Derek

    Thanks for replying. Although not new to programmatically using databases I'm new to using sql server and not being familiar with it's terminology leaves me scratching my head while I try and hunt down what the error messages mean.

    I've tried using both integrated security and adding my own user with a password. I know I'm probably missing something fundamental and thought maybe you had just given me the key. Unfortunately it doesn't appear to be the complete answer.

    |||if you dont care about how you connect, for simplication purposes use sql authentication in your client code. create the account in sql server assign it's default database and ensure the sql account has atleast public (read) permission to that database.|||

    Derek

    I don't care at the moment how I connect. I would just like to see it connect.

    I had already tried sql authentication before without success. After your response I tried again, messing with the connection string. No success.

    |||is sql authentication enabled?|||

    Derek

    In SQL Server Management under Logins I've added a user called pubsub, set his login to SQL Server authentication and set his password. Then under User Mappings I made sure that public, reader, writer were checked.

    In my application I used the following connection string,

    "Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\WebServicesDemo\\PubSub\\App_Data\\PubSubDB.mdf;Database=PubSubDB;User ID=pubsub;Password=pspwd; Integrated Security=False;User Instance=True"

    The connection error I get is

    Login failed for user 'pubsub'. The user is not associated with a trusted SQL Server connection.|||you can run this code

    USE [master]

    GO

    EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2

    GO

    or simply enable sql authentication via the GUI/Mgmt. Studio. and restart the server after making the change.

    |||

    Derek

    I found the place in the gui under Server properties where I was able to set Server authentication to SQL Server. I then restarted SQL Server. The response I now get from a connection attempt is

    Failed to generate a user instance of SQL Server. Only an integrated connection can generate a user instance. The connection will be closed.

    Another interesting piece to this puzzle. My test setup involves a web application that makes a call to a web service. For simplification I moved the code to open the database to the web application using Windows authentication. It worked. I took the same code back to my web service and it doesn't work. What does that suggest? I tried that again with the current setup and received the same error above.

    |||

    Sorry, I hit the submit button to soon. I also meant to tell you that when I set Integrated Security=true, the connection in the web application works. When I set Integrated Security=true in the web service I get the following error

    Unable to open the physical file \"C:\\WebServicesDemo\\PubSub\\App_Data\\PubSubDB.mdf\". Operating system error 5: \"5(Access is denied.)\".\r\nCould not attach file 'C:\\WebServicesDemo\\PubSub\\App_Data\\PubSubDB.mdf' as database 'PubSubDB'.

    |||

    Derek

    Some more information. I noticed that although I've supposedly enabled SQL Server authentication (mixed mode), the connection properties Authentication method still show Windows Authentication. I tried to issue your registry change from sqlcmd and received

    RegCreateKeyEx() returned error 5, 'Access is denied.'

    So I created the key and value manually. It didn't change the connection property Authentication method which still showed Windows Authentication.

    Everything I've try seems to work in the web application, but not in the Web Service. In the Web Service, I still received the "Unable to open the physical file" error.

    |||

    Derek

    If your still following this I solved my problem. Although I knew it wouldn't be an acceptable final answer I decided as another data point to set impersonation in the web service web.config file using my personal login information. That worked, which confirmed to me the problem definitely had to do with the permissions of the web service account (I don't alway trust error messages).

    So then I looked again at the account information to the database file itself. When I created the database using Visual Studio, VS put the database in the web services data directory and created a weird sqlexpress account (SQLServer2005MSSQLUser$WD49832$SQLEXPRESS (WD49832\SQLServer2005MSSQLUser$WD49832$SQLEXPRESS)) which I had just accepted managed VS's access to the database. Well I shouldn't trust MS to be so kind. I still don't know the purpose of that account but it obviously doesn't handle the application's access. Once I added the users group to the database file and gave them the necessary permissions it worked. I'm going to claim that there were just to many things I didn't understand in the beginning so I stepped into accepting bad assumptions. The upside I've learned more than I would had it been easy.

    Thanks for your company and help while I struggled through that one.

    |||your welcome and to be honest you taught me that "user instances" something I never use YET have to be used in conjunction with Integrated (windows) authentication. (which makes sense)

    Friday, March 9, 2012

    permissions

    I am working http location and using sql server 2005 ,it is showing an error as " DELETE permission denied on object 'CourseDetails', database 'LOGIN', schema 'dbo'." CourseDetails is my table name and LOGIN is my database name.

    Goto SQL Server Management Studio 2005--> Goto your database (LOGIN)--> Right click on the table name (CourseDetails)--> Select Properties

    There goto the Permissions tab and click add... You can add the permission here...

    But the question is WHY would you want to add delete permissions on your SQL Table? What you should do is write a Stored Procedure to delete the data in there and give the procedure execute permissions.

    |||

    Thank u deepak

    Wednesday, March 7, 2012

    permission-1

    http://www.abvalve.com/careers/form/

    can someone please tell me whats the problem with this?

    I actually gave that user permission and and still did not work, the DB is in the appdb folder and the network services user is granted full permisions on that folder!

    Any ideas

    forgot to close connection to DB before i viewed? :)

    Monday, February 20, 2012

    Permission Denied Javascript errors

    I have a report I've been running for several months using a URL like the one
    below:
    http://server/ReportServer?/folder/report&rs:Command=Render
    I updated the report today and now I get 2 "Permission Denied" javascript
    errors when the page loads. One is in function OnLoadToolbar calling
    SetShowHideParameters and the other is in function LoadToolbarFrame on an if
    statement (if (frames["oTbDMRepFram"0.location... The report works fine when
    I go to the report manager in my browser and works fine in VS.NET. Any help
    is appreciated.I found a workaround. I had unchecked "Show Friendly HTTP Errors" in my
    browser. When I re-activated it, the report runs fine.
    "jweesies" wrote:
    > I have a report I've been running for several months using a URL like the one
    > below:
    > http://server/ReportServer?/folder/report&rs:Command=Render
    > I updated the report today and now I get 2 "Permission Denied" javascript
    > errors when the page loads. One is in function OnLoadToolbar calling
    > SetShowHideParameters and the other is in function LoadToolbarFrame on an if
    > statement (if (frames["oTbDMRepFram"0.location... The report works fine when
    > I go to the report manager in my browser and works fine in VS.NET. Any help
    > is appreciated.
    >

    permission denied

    iam working with http location and using sql server 2005its getting an error as "SELECT permission denied on object UserDetails' database 'elearning', schema 'dbo'.""UserDetails" is my table name"elearning" is database namei worked same project with filesystem location ,there it is workingThis is obviously a permissions issue. You need to ensure that the user your connected to the database with has select permissions on at least the "UserDetails" table.|||

    It is a issue retaled to lack of permission for the user account you are using to connect.

    To resolve this issue in SQL management Studio right click the username which is placed under Security => Login.

    A modal window will be opened and in User Mapping section setect the desired DB and check db_datareader for that user. Click ok. Now you are done.

    Let me know if need any further clarifications

    permission denied

    iam working with http location and using sql server 2005 its getting an error as "INSERT permission denied on object CourseDetails, database 'mydb', schema 'dbo'." "CourseDetails" is my table name "mydb" is database name i worked same project with filesystem location ,there it is working

    This is almost certainly being caused because the account that is running the web site (ASPNET or NETWORK SERVICE, depending on which version of IIS you're running) is not allowed permission to access the SQL Server database. Note that for a file based application, running under the development web server, your user account will have been used.

    Check the connection string that is being used in the web site. If it is using integrated security (likely), then you will need to ensure that the ASPNET or NETWORK SERVICE account (or, more precisely, the account that is being used to run the web site) is allowed access to the database.