The EXECUTE permission was denied on the object 'sp_cursoropen', database 'mssqlsystemresource', sch

Discussion in 'Databases' started by raymondp, Jul 2, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. ubarone
    We do not have the JDBC driver installed on our servers and thus you should not be able to use this provider. I am surprised to hear that

    stmt = mConn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.COCUR_READONLY);
    rs = stmt.executeQuery(sqlStat);

    works for you. What provider are you using for this?
     
  2. I'm using Microsoft SQL Server 2005 JDBC Driver 1.1 (sqljdbc.jar)

    Do I have anyway of connecting to my hosted database on DiscountASP using Java in order to perform updates? What I'm trying to do is to use application compiled query statements and not stored procedures
     
  3. I'm trying to access DiscountASP SQL 2005 using sqljdbc.jar in order in ordre to do updates. However, when I try to execute Query on CONCUR_UPDATABLE I fail. When using COCUR_READONLY all works well.

    The exception I receive on simple SQL statement "select * from [dbname].dbo.[tablename]" is:

    Processing line #102 Jul 2007 15:09:44,698 ERROR CSQL2005DBConnection:127 - Failed to execute SQL update: select * from SQL2005_367413_bandp.dbo.BackOffice_Domain_Leaders
    com.microsoft.sqlserver.jdbc.SQLServerException: The EXECUTE permission was denied on the object 'sp_cursoropen', database 'mssqlsystemresource', schema 'sys'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PreparedStatementExecutionRequest.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.cursorOpen(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
    at utils.db.CSQL2005DBConnection.executeUpdate(CSQL2005DBConnection.java:123)
    at backoffice.db.CProductionDB.createNewLeader(CProductionDB.java:191)
    at backoffice.SLCreation.CMain.main(CMain.java:155)
    DB error, failed to create leader: com.microsoft.sqlserver.jdbc.SQLServerException: The EXECUTE permission was denied on the object 'sp_cursoropen', database 'mssqlsystemresource', schema 'sys'.. Skiping to next line





    I'd be glad to receive any useful advice


    Thank you,


    Udi





    CODE WHICH DOESN'T WORK:
    stmt = mConn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
    rs = stmt.executeQuery(sqlStat);




    CODE WHICH WORKS:


    stmt = mConn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.COCUR_READONLY);
    rs = stmt.executeQuery(sqlStat);
     
  4. I'm not trying to access any stored procedure. What I'm doing is running an SQL statement in form of 'select * from [dbname].dbo.[tablename]. Why did you claim that it shouldn't work in the first place?
     
  5. Bruce

    Bruce DiscountASP.NET Staff

    Because of this error


    "The EXECUTE permission was denied on the object 'sp_cursoropen', database 'mssqlsystemresource', schema 'sys'."




    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  6. I'm explicitly right the database and the table name I want to query:

    select * from [mydatabase].dbo.[mytable].

    Why should there be permission problem?

    I appreciate anyones help
     
  7. Bruce

    Bruce DiscountASP.NET Staff

    The error comes from SQL rather than the database driver.


    I think your query is trying to access some system stored proc that you do not have access to.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  8. JorgeR

    JorgeR DiscountASP.NET Staff

    Can you state what user you are using - the default sql login user assigned to you by DASP or an extra login? Have you tried running the query directly into sql management and see if it returned the results


    junior

    DiscountASP.NET

    www.DiscountASP.NET
     
  9. I've upgraded to sqljdbc version 1.2. I've also surpressed the exception thrown when closing the ResultSet. Bottom line, it works now.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page