SELECT permission denied...

L

Lastie

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top