473,757 Members | 5,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Still Trying to Figure Out Identification of SQL Server Stored Proc. Permissions via VB

I've looked through many suggestions and partial examples all over
this newsgroup and still am not coming up with anything that does
specifically what I'm wanting to accomplish.

I'm writing a VB 6.0 application which uses SQL Server as the
back-end.

Here's an example of what I'm wanting to do...

A user accessing the VB GUI attempts to open a certain form. Code
runs behind the scenes in VB that checks the user's "Execute"
permissions on the stored procedure that retrives the data into the
form. If the user is determined to have "Execute" permissions to that
stored procedure, the user is allowed to proceed with opening the
form. If they don't have permissions, they are informed of this and
aren't allowed to open the form and view the data.

Let's say that we initially determine through the VB code that the
user has the ability to "Execute" the stored procedure that allows for
viewing of the data. We go ahead and let them open the form. Once
the form is being opened though, we run VB code to check for their
permissions on other stored procedure that can be used in UPDATING /
INSERTING / DELETING the records being displayed in the form. If they
don't have "Execute" permissions on these particular
Update/Insert/Delete stored procedures, then I'll have a text box on
the form show as visible to advise them while they're looking at this
data that they can't do anything to this data other than view it...
they can't insert new records, they can't delete any records, and they
can't update any records.

I have yet to find specific code that tells me how to check
permissions on a storedc procedure for the user that's logged-in, what
the resulting codes (i.e. 12291, etc.) mean as far as identification
of their permissions, etc.

If anyone can help me out here, I'd greatly appreciate it. I'd hate
to just have to resort to trying to allow the user to run the stored
procedures and just trap the error codes that may arise once each
stored procedure is executed and inform the user on the tail-end of
the process that they can't run the stored procedure. I'd like to
identify their permissions to the stored procedures on the front-end
of the process either before each form is opened or just as it's
opening to advise them early as to what they can/can't do with the
data being displayed in the form.

Thanks in advance for any examples/information!

Sincerely,
Brad H. McCollum
bm******@midsou th.rr.com
Jul 20 '05 #1
1 1983
[posted and mailed, posted and mailed]

Brad H McCollum (bm******@midso uth.rr.com) writes:
I have yet to find specific code that tells me how to check
permissions on a storedc procedure for the user that's logged-in, what
the resulting codes (i.e. 12291, etc.) mean as far as identification
of their permissions, etc.


If the expresion:

permissions(obj ect_id('dbo.you rprocedure')) & 0x20

returns a non-zero value, the user has permission to execute the procedure,
else not.

You can read more about the Permissions() function Books Online.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

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

Similar topics

3
7034
by: Greg D. Moore \(Strider\) | last post by:
Ok, I thought this one would be easy. I have a stored proc: master.dbo.restore_database_foo This is on database server B. Database server A backs up database foo on a daily basis as a scheduled task. What I wanted to do was, at the end of the scheduled task is then call the
2
20011
by: aaj | last post by:
Hi all I have a stored procedure that has the line EXEC master..xp_cmdshell 'dtsrun /Stestjob1 /N testdts /E' If I run the SP from an access front end as a trusted user or from a scheduled job it runs fine and exectues the dts. If I run the stored procedure using VB6 as a standard connection the dtsjob
45
3408
by: John | last post by:
Hi When developing vb.bet winform apps bound to sql server datasource, is it preferable to use SELECTs or stored procedure to read and write data from/to SQL Server? Why? Thanks Regards
2
1289
by: David C | last post by:
I have an aspx page with an editible GridView. When I click the Update button the stored procedure runs (I know because the underlying data was changed) but throws an exception as follows: Source: .Net SqlClient Data Provider An unhandled exception occurred: Message: Cannot find the object 'rfp_updPeopleAndLink', because it does not exist or you do not have permission.
0
9904
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7285
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6556
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5324
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3828
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3395
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2697
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.