4

Well, I'm creating an app web with Cold Fusion, every time I debug my project in the browser I get this error:

Error Executing Database Query.

[Macromedia][SQLServer JDBC Driver][SQLServer] The SELECT permission was denied on the object 'users', database 'hotel', schema 'dbo'

I'm using a user called CFLogin and I grant to him select permissions through this command in SQL Server:

USE hotel
GO
GRANT SELECT ON dbo.users TO CFLogin

Also I've executed the follows stored procedures to give roles to my user:

EXEC sp_addrolemember 'db_owner',CFLogin
EXEC sp_addrolemember 'db_datareader',CFLogin
EXEC sp_addrolemember 'db_accessadmin',CFLogin

But it always results in the same message: Select permission was denied on object... I've even rebooted the service but nothing seems working at all.

What am I doing wrong?

Regards!

3
  • 1
    It would appear that you're connected under a different login - not CFLogin Commented Nov 14, 2012 at 23:07
  • try Select user_ID(),User_name(),CURRENT_USER
    – bummi
    Commented Nov 14, 2012 at 23:08
  • I'm connected with CFLogin and that's select works, but not my select pointing to users table
    – Enot
    Commented Nov 14, 2012 at 23:14

1 Answer 1

6

I also encountered a similiar issue while taking coldfusion enabled website in a Windows 2008 server running IIS 7. Executing the below queries helped resolve the issue for me,

use DATABASENAME
grant select on dbo.TABLENAME to public; 

Executing the above query from sql prompt helped resolving this issue for me. Replace DATABASENAME and TABLENAME with your sql server database and tablename which is shown in error.

2
  • could you just grant permission to the user, rather than to all users? or am I misunderstanding this command?
    – MERLIN
    Commented May 1, 2019 at 19:08
  • Our DBA disallows to do that. Any other clues?
    – Hello
    Commented Jul 28, 2020 at 14:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.