Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server - Table Permissions

Status
Not open for further replies.

pwel

Programmer
Aug 18, 1999
79
GB
Hi,

Is there any way, using asp, that I can test whether a user has permissions on a certain table in an SQL Server db.

I.E. Before i do a select on (myTable)

I wish to check that the current user has permissions to select from (myTable)?

Cheers in advance.

PW.

Paul Welding
Web Developer
 
Use connection object to connect to database with an user and pwd that you have

'turn error trapping on
On Error Resume Next

Conn.Open "..."
If Err.number <> 0 then
'we have an error wich means that user cannot access the database
end if

'turn error trapping off
On Error Goto 0

You can check to see what is the error number when an user has no right over an database.

________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top