472,794 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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

Aug 21 '07 #1
7 5191
monty (ma************@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, es****@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
Aug 21 '07 #2
On Aug 22, 2:46 am, Erland Sommarskog <esq...@sommarskog.sewrote:
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.....

Aug 22 '07 #3
monty (ma************@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, es****@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
Aug 22 '07 #4
On Aug 22, 3:31 pm, Erland Sommarskog <esq...@sommarskog.sewrote:
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 ??
Aug 22 '07 #5
monty (ma************@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, es****@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
Aug 22 '07 #6
On Aug 22, 6:56 pm, Erland Sommarskog <esq...@sommarskog.sewrote:
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??

Aug 22 '07 #7
monty (ma************@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, es****@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
Aug 22 '07 #8

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

Similar topics

1
by: Steve Thorpe | last post by:
Hi. I have two sql servers and have ran exec sp_addlinkedserver 'ACSPSM', N'SQL Server' to link one to the other and also vise versa. Each server has two users permissioned. My problem is...
1
by: Tyler Smith Watu | last post by:
I am trying to come up with a stored procedure to grant all users db_owner role (rather than have to manually check the users each time) Thanks in advance for your help TY
2
by: Tjerk Wolterink | last post by:
Hello i've an xpath problem using sablatron in php. In xsl i have the following code: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"...
1
by: liorhal | last post by:
is there a command that can change a login role to db_owner in all the tables, or do i have to use { USE table_name EXEC sp_adduser 'login name' EXEC sp_addrolemember 'db_owner', 'login name' }...
0
by: Jer | last post by:
I am the owner of a database with other users. I have given all users db_owner role. My server is MSDE 2000. I use the following code to import a spreadsheet: docmd.transferspreadsheet acImport,...
1
by: db55 | last post by:
I have some users that I need to run stored procedures, but they can't seem to run them unless they are in the db_owner role of the database. How do I give them access to run the stored procs...
2
by: Vaap | last post by:
I did lot of googling to see if I can solve the SQL server not found problem while trying to run ASP.Net community starter kit from an XP machine to Windows 2003 server hosting SQL server 2000...
1
by: SkyGringo | last post by:
Hi, I'm using the 64-bit version of SQL Server 2005, SP2, on Windows Server 2003 R2 X64 Enterprise Edition. I've got a bunch of users out there who are the db_owner, db_accessadmin and...
5
by: rhaazy | last post by:
I am trying to a simple insert statement from a remote application against a sql server 2005 database. To fix the problem I was having, I had to grant the Login I was using the role of sysadmin. ...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.