473,287 Members | 1,582 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,287 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 5218
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. ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.