PC Review


Reply
Thread Tools Rate Thread

Connecting to Sql Server 2005

 
 
ann
Guest
Posts: n/a
 
      12th Feb 2008
I am trying to get my application (.net 1.1, c#) to run some sp's (sql server
2005). I can finally connect to my db, but when I get to the part that
executes the sp's I get the infamous EXECUTE permission denied on object blah
blah blah....!

When I check the permissions on the stored procedure, I have granted execute
on the sp for the user - so I don't understand why I can't execute it!

My connection string:

<add key="SqlConnect" value="SERVER=***\***;Initial
Catalog=*****;UID=user;PWD=pass;" />

I am using sql server authentication - I created a SQL server user in the
logins, mapped it to the database, grant permission to connect to db, login
enabled.

from the database, for each sp, the user has execute.

Sorry if I sound frustrated, it's because I am.

Can someone please explain exactly how to grant the permission - I am
probably missing something - but when the user is granted permission to
execute a sp, that should be enough..no?

So, all I want to do is create a user that can connect to the db and execute
sp's - I want to be able to pass these credentials via my application - so if
anyone can tell me how to create the user and how I can have them execute the
sp and use those credentials the way I described - I would very much
appreciate it.

Any help would be soo appreciated - I am so tired of this!

 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      13th Feb 2008
What "user" have you given permission to? If this is an ASP .NET
application, it needs to be the ASPNET user account that has permission to
execute your SP's, not the actual user (person) that is using your
application.


"ann" <(E-Mail Removed)> wrote in message
news:5B69A16E-71CE-494D-A958-(E-Mail Removed)...
>I am trying to get my application (.net 1.1, c#) to run some sp's (sql
>server
> 2005). I can finally connect to my db, but when I get to the part that
> executes the sp's I get the infamous EXECUTE permission denied on object
> blah
> blah blah....!
>
> When I check the permissions on the stored procedure, I have granted
> execute
> on the sp for the user - so I don't understand why I can't execute it!
>
> My connection string:
>
> <add key="SqlConnect" value="SERVER=***\***;Initial
> Catalog=*****;UID=user;PWD=pass;" />
>
> I am using sql server authentication - I created a SQL server user in the
> logins, mapped it to the database, grant permission to connect to db,
> login
> enabled.
>
> from the database, for each sp, the user has execute.
>
> Sorry if I sound frustrated, it's because I am.
>
> Can someone please explain exactly how to grant the permission - I am
> probably missing something - but when the user is granted permission to
> execute a sp, that should be enough..no?
>
> So, all I want to do is create a user that can connect to the db and
> execute
> sp's - I want to be able to pass these credentials via my application - so
> if
> anyone can tell me how to create the user and how I can have them execute
> the
> sp and use those credentials the way I described - I would very much
> appreciate it.
>
> Any help would be soo appreciated - I am so tired of this!
>



 
Reply With Quote
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      13th Feb 2008
When you create the logon (or alter the login) in Enterprise Manager
(Express Manager for SQL Express) go to the User Mappings tab and gie the
user NOT ONLY access to the database in question, but give it a role that
allows it the permissions it will need. db_owner gives all permissions, but
also allows hackers who compromise your web.config free reign. But, you
probably need at least reader and writer permissions. Or, you can write a
stored procedure "layer" to shield the underlying tables and grant
individual rights to the sprocs in question.

There are ways to set up for Windows Authentication, if that is possible
(not usually with an ISP, unless they set up the user as part of your
account set up).

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
"ann" <(E-Mail Removed)> wrote in message
news:5B69A16E-71CE-494D-A958-(E-Mail Removed)...
>I am trying to get my application (.net 1.1, c#) to run some sp's (sql
>server
> 2005). I can finally connect to my db, but when I get to the part that
> executes the sp's I get the infamous EXECUTE permission denied on object
> blah
> blah blah....!
>
> When I check the permissions on the stored procedure, I have granted
> execute
> on the sp for the user - so I don't understand why I can't execute it!
>
> My connection string:
>
> <add key="SqlConnect" value="SERVER=***\***;Initial
> Catalog=*****;UID=user;PWD=pass;" />
>
> I am using sql server authentication - I created a SQL server user in the
> logins, mapped it to the database, grant permission to connect to db,
> login
> enabled.
>
> from the database, for each sp, the user has execute.
>
> Sorry if I sound frustrated, it's because I am.
>
> Can someone please explain exactly how to grant the permission - I am
> probably missing something - but when the user is granted permission to
> execute a sp, that should be enough..no?
>
> So, all I want to do is create a user that can connect to the db and
> execute
> sp's - I want to be able to pass these credentials via my application - so
> if
> anyone can tell me how to create the user and how I can have them execute
> the
> sp and use those credentials the way I described - I would very much
> appreciate it.
>
> Any help would be soo appreciated - I am so tired of this!
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
An error has occurred while establishing a connection to the server.When connecting to SQL Server 2005, this failure may be caused by the factthat under the default settings SQL Server does not allow remote connections. mina Microsoft VB .NET 0 8th Oct 2008 07:12 AM
An error has occurred while establishing a connection to the server.When connecting to SQL Server 2005, this failure may be caused by the factthat under the default settings SQL Server does not allow remote connections. mina Microsoft Dot NET 0 8th Oct 2008 07:11 AM
Help. Getting a An error has occurred while establishing a connectionto the server. When connecting to SQL Server 2005, this failure may be causedby the fact that under the default settings SQL Server does not allow remote aboutjav.com@gmail.com Microsoft ASP .NET 0 3rd May 2008 01:43 PM
Connecting to a SQL Server 2005 using VBA and ADO =?Utf-8?B?QnJpYW4=?= Microsoft Access Form Coding 2 13th Jun 2007 01:14 AM
Re: Connecting to SQL Server 2005 Ginny Caughey [MVP] Microsoft Dot NET Compact Framework 0 22nd Dec 2006 04:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:55 PM.