473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

SELECT permission denied...

Hi all,

I’m an ASP developer but I just started to try and learn ASP.NET. I have
the following code but it seems like I have a permissions problem.

<%@ Page Language="VB" Debug="true" %>
<%@ import namespace="System.Data" %>
<%@ import namespace="System.Data.SqlClient" %>

<%
Dim connWebLinks As New SqlConnection("Data Source=(local);Initial
Catalog=dbWebLinks;Integrated Security=SSPI")
Dim Cmd As New SqlCommand("SELECT * FROM tblLinks", connWebLinks)
connWebLinks.Open
Dim myReader = Cmd.ExecuteReader()

myReader.Close
connWebLinks.Close
%>

I get this error:

System.Data.SqlClient.SqlException: SELECT permission denied on object
'tblLinks', database 'dbWebLinks', owner 'dbo'.

I have added <computer name>\ASPNET to the ‘users’ for the database
‘dbWeblinks’ in SQL Server and given it all the permissions I can see, this
includes SELECT on the table ‘tblWeblinks’.

Can anyone help me?

Thanks,

Steve
Nov 18 '05 #1
4 4575
Did you ADD the user or did you SELECT the user? SQL Server supports 2 types
of user accounts: SQL Server and Windows. If you type in what you told us
you added, you aren't selecting a Windows user; you're creating a SQL Server
user. Since you're using Integrated Security, you would need to SELECT the
Windows account, and grant that the necessary permissions.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Lastie" <La****@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com...
Hi all,

I'm an ASP developer but I just started to try and learn ASP.NET. I have
the following code but it seems like I have a permissions problem.

<%@ Page Language="VB" Debug="true" %>
<%@ import namespace="System.Data" %>
<%@ import namespace="System.Data.SqlClient" %>

<%
Dim connWebLinks As New SqlConnection("Data Source=(local);Initial
Catalog=dbWebLinks;Integrated Security=SSPI")
Dim Cmd As New SqlCommand("SELECT * FROM tblLinks", connWebLinks)
connWebLinks.Open
Dim myReader = Cmd.ExecuteReader()

myReader.Close
connWebLinks.Close
%>

I get this error:

System.Data.SqlClient.SqlException: SELECT permission denied on object
'tblLinks', database 'dbWebLinks', owner 'dbo'.

I have added <computer name>\ASPNET to the 'users' for the database
'dbWeblinks' in SQL Server and given it all the permissions I can see, this includes SELECT on the table 'tblWeblinks'.

Can anyone help me?

Thanks,

Steve

Nov 18 '05 #2
When you say that you gave every permission, you didn't by chance accidently
give them "deny_datareader" did you? The datareader permission is what is
needed for that.
Nov 18 '05 #3
Thanks for the reply kevin...

I'm pretty sure i added the account by selecting it, and that i didn't
create a new sql server account, however i have since removed the account,
and added (by selecting) it again and it now works fine. Maybe i did create
the sql account as you suggest, by accident.

Anyway thanks for your help on this one :-)

Steve


"Kevin Spencer" wrote:
Did you ADD the user or did you SELECT the user? SQL Server supports 2 types
of user accounts: SQL Server and Windows. If you type in what you told us
you added, you aren't selecting a Windows user; you're creating a SQL Server
user. Since you're using Integrated Security, you would need to SELECT the
Windows account, and grant that the necessary permissions.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Lastie" <La****@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com...
Hi all,

I'm an ASP developer but I just started to try and learn ASP.NET. I have
the following code but it seems like I have a permissions problem.

<%@ Page Language="VB" Debug="true" %>
<%@ import namespace="System.Data" %>
<%@ import namespace="System.Data.SqlClient" %>

<%
Dim connWebLinks As New SqlConnection("Data Source=(local);Initial
Catalog=dbWebLinks;Integrated Security=SSPI")
Dim Cmd As New SqlCommand("SELECT * FROM tblLinks", connWebLinks)
connWebLinks.Open
Dim myReader = Cmd.ExecuteReader()

myReader.Close
connWebLinks.Close
%>

I get this error:

System.Data.SqlClient.SqlException: SELECT permission denied on object
'tblLinks', database 'dbWebLinks', owner 'dbo'.

I have added <computer name>\ASPNET to the 'users' for the database
'dbWeblinks' in SQL Server and given it all the permissions I can see,

this
includes SELECT on the table 'tblWeblinks'.

Can anyone help me?

Thanks,

Steve


Nov 18 '05 #4
Thanks for the reply Scott, no i didn't touch the role membership so maybe
my statement about giving it all permissions was wrong... The only ones i
changed were the select/update etc on the table...

Thanks again though... :-)

Steve

"Scott Simons" wrote:
When you say that you gave every permission, you didn't by chance accidently
give them "deny_datareader" did you? The datareader permission is what is
needed for that.

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Klunk | last post by:
Hi, last week I moved the folder of my Intranet application to another disk of the same server. After this change all the ASP page return this error: Microsoft VBScript runtime error...
1
by: Mark E. Hamilton | last post by:
Sorry, I probably should have re-stated the problem: We're using Python 2.3.5 on AIX 5.2, and get the follow error messages from some of our code. I haven't yet tracked down exactly where it's...
1
by: Amin Schoeib | last post by:
Hi, I have a problem with permissions for SELECT. Here is what I did: test=> GRANT SELECT ON "poi"."fondsstamm" TO "flex"; GRANT test=> \dp fondsstamm; Access privileges for database...
0
by: Reshma Prabhu | last post by:
Hello, I am getting following exception while trying to execute a SELECT query on a table even though it has all the SELECT rights. The SQLServer is running on local machine. The server running...
1
by: Mr.KisS | last post by:
Hi, In my aspx page i use a stocked procedure and in this procedure, there is a SELECT query. And whene the aspx page calls the procedure i get this exception : ...
4
by: stephen | last post by:
Hi, I am getting an error while trying to create an excel file. "Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the...
0
by: debug03 | last post by:
I am executing a DTS package on a Windows 2000 sp4 server running SQL Server 2000 and IBM DB2 V7 client. The DTS package source data(SQL Server) is selected from SQL server table and inserts data to...
0
by: private.anders | last post by:
Hi David! Really need assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
0
by: private.anders | last post by:
Really need your assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.