Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
hdv212
Posting Yak Master
140 Posts |
Posted - 2008-05-21 : 16:56:06
|
| hii want when user connect to sql server and wants to do some works via my app, before doing nothing, check accessibility of user whether he/she can access that object or not, but i don't know which sp or function or view is useful for this work,can anyBody help me ?thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-21 : 16:58:47
|
| This doesn't make sense. Just run your query and catch the error if the user doesn't have permissions. Act according to the error.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
 |
|
|
hdv212
Posting Yak Master
140 Posts |
Posted - 2008-05-21 : 17:10:43
|
| thanks tKizerbut i want to when user could not access to that object, my app display an Appropriate message to it ?how to handle this type of exception ?thanks |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-21 : 17:12:08
|
| You will know when you catch the error. Use a Try/Catch and in the catch put your message code when a permissions error has occurred.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
 |
|
|
hdv212
Posting Yak Master
140 Posts |
Posted - 2008-05-21 : 17:14:13
|
| which exception has permission error ? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-21 : 17:19:23
|
| It should be error 229.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
 |
|
|
hdv212
Posting Yak Master
140 Posts |
Posted - 2008-05-21 : 17:37:35
|
| thanks tkizeri was test your suggestion in sample app and works correctly.very thanks.regards |
 |
|
|
|
|
|