Unix Technical Forum

Problem with DB_OWNER role..

This is a discussion on Problem with DB_OWNER role.. within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi All, I am facing a problem while executing a statement through C++ code using OLEDB API of Sql ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-01-2008, 02:40 PM
monty
 
Posts: n/a
Default Problem with DB_OWNER role..

Hi All,

I am facing a problem while executing a statement through C++ code
using OLEDB API of Sql server.
There is a problem with DB_OWNER role. If I will enable the DB_OWNER
everything is going fine but if I will remove this role than I am
getting error "DB_E_ERRORSINCOMMAND".

But if I will execute the same in query analyser it is going
absolutely fine in either case.
I am not able to understand why I am getting error while using API.

Please help me......thanks in advance

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-01-2008, 02:40 PM
Erland Sommarskog
 
Posts: n/a
Default Re: Problem with DB_OWNER role..

monty (manishgandhi13@gmail.com) writes:
> I am facing a problem while executing a statement through C++ code
> using OLEDB API of Sql server.
> There is a problem with DB_OWNER role. If I will enable the DB_OWNER
> everything is going fine but if I will remove this role than I am
> getting error "DB_E_ERRORSINCOMMAND".
>
> But if I will execute the same in query analyser it is going
> absolutely fine in either case.
> I am not able to understand why I am getting error while using API.


I'm afraid that I need to ask for more information. What do you mean
with "enable the DB_OWNER role"? Do you mean that you add the user
you connect with to the DB_OWNER role?

Do you run with the same user from QA?

Have you examined the ISqlServerErrorInfo object to get the error message?


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-01-2008, 02:40 PM
monty
 
Posts: n/a
Default Re: Problem with DB_OWNER role..

On Aug 22, 2:46 am, Erland Sommarskog <esq...@sommarskog.se> wrote:
> monty (manishgandh...@gmail.com) writes:
> > I am facing a problem while executing a statement through C++ code
> > using OLEDB API of Sql server.
> > There is a problem with DB_OWNER role. If I will enable the DB_OWNER
> > everything is going fine but if I will remove this role than I am
> > getting error "DB_E_ERRORSINCOMMAND".

>
> > But if I will execute the same in query analyser it is going
> > absolutely fine in either case.
> > I am not able to understand why I am getting error while using API.

>
> I'm afraid that I need to ask for more information. What do you mean
> with "enable the DB_OWNER role"? Do you mean that you add the user
> you connect with to the DB_OWNER role?
>
> Do you run with the same user from QA?
>
> Have you examined the ISqlServerErrorInfo object to get the error message?
>
> --
> Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
>
> Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
> Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


yes by enabling the DB_OWNER i mean giving DB_OWNER role to the user.
And I am running with the same user in QA with which i am connecting
through API.

Also I have examined ISqlServerErrorInfo object to get the error
message because of that only I am getting error DB_E_ERRORSINCOMMAND.

Feel free to ask for more information.....

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-01-2008, 02:40 PM
Erland Sommarskog
 
Posts: n/a
Default Re: Problem with DB_OWNER role..

monty (manishgandhi13@gmail.com) writes:
> yes by enabling the DB_OWNER i mean giving DB_OWNER role to the user.
> And I am running with the same user in QA with which i am connecting
> through API.
>
> Also I have examined ISqlServerErrorInfo object to get the error
> message because of that only I am getting error DB_E_ERRORSINCOMMAND.
>
> Feel free to ask for more information.....


I guess then I would need to see your code, including the error-handling
part...



--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-01-2008, 02:40 PM
monty
 
Posts: n/a
Default Re: Problem with DB_OWNER role..

On Aug 22, 3:31 pm, Erland Sommarskog <esq...@sommarskog.se> wrote:
> monty (manishgandh...@gmail.com) writes:
> > yes by enabling the DB_OWNER i mean giving DB_OWNER role to the user.
> > And I am running with the same user in QA with which i am connecting
> > through API.

>
> > Also I have examined ISqlServerErrorInfo object to get the error
> > message because of that only I am getting error DB_E_ERRORSINCOMMAND.

>
> > Feel free to ask for more information.....

>
> I guess then I would need to see your code, including the error-handling
> part...
>
> --
> Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
>
> Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
> Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


it's ok....but i just want to know....do we need to have DB_OWNER role
for executing DDL statements through OLEDB API ??


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-01-2008, 02:40 PM
Erland Sommarskog
 
Posts: n/a
Default Re: Problem with DB_OWNER role..

monty (manishgandhi13@gmail.com) writes:
> it's ok....but i just want to know....do we need to have DB_OWNER role
> for executing DDL statements through OLEDB API ??


DDL statements require at least membership in db_ddladmin, no matter how you
connect.




--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 03-01-2008, 02:40 PM
monty
 
Posts: n/a
Default Re: Problem with DB_OWNER role..

On Aug 22, 6:56 pm, Erland Sommarskog <esq...@sommarskog.se> wrote:
> monty (manishgandh...@gmail.com) writes:
> > it's ok....but i just want to know....do we need to have DB_OWNER role
> > for executing DDL statements through OLEDB API ??

>
> DDL statements require at least membership in db_ddladmin, no matter how you
> connect.
>
> --
> Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
>
> Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
> Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


I am creating and using a temp table. For doing this db_ddladmin role
will be enough??

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 03-01-2008, 02:40 PM
Erland Sommarskog
 
Posts: n/a
Default Re: Problem with DB_OWNER role..

monty (manishgandhi13@gmail.com) writes:
> I am creating and using a temp table. For doing this db_ddladmin role
> will be enough??


I'm sorry, but I would appreciate if you could post your actual code
or in other ways to give me sufficient information what you are doing.
If you insist on just providing pieces, the quality of the answers you
get will be poor.

To create temp tables you need no particular permissions at all.



--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:44 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com