Board index » delphi » How to check access rights on MS SQL7

How to check access rights on MS SQL7

Before running some code to modify the database structure, I need to check
to see if the current connection has db_owner rights.

There is a IS_MEMBER procedure in MS SQL that returns an integer value to
denote whether or not they are a member.

In MS SQL Query Analyser I can type

  IF IS_MEMBER ('db_owner') = 1
  print 'Yes'
  else
  print 'No'

which returns 'Yes' or 'No'

How can I get to this from within Delphi?

Any help much appreciated!

Regards

Pete Colson

 

Re:How to check access rights on MS SQL7


If you can do it in Query Analyser then you can do with a simple query:
Select IS_MEMBER ('db_owner') as IsDbOwner
--
Finn Tolderlund

Quote
"Peter Colson" <p...@pc-ss.co.uk> wrote in message

news:3db9287a$1@newsgroups.borland.com...
Quote
> In MS SQL Query Analyser I can type

>   IF IS_MEMBER ('db_owner') = 1
>   print 'Yes'
>   else
>   print 'No'

> which returns 'Yes' or 'No'

> How can I get to this from within Delphi?

Re:How to check access rights on MS SQL7


Thanks very much, it works!

Pete Colson

Quote
"Finn Tolderlund" <f...@nospam.com> wrote in message

news:3db92fb3@newsgroups.borland.com...
Quote
> If you can do it in Query Analyser then you can do with a simple query:
> Select IS_MEMBER ('db_owner') as IsDbOwner
> --
> Finn Tolderlund

> "Peter Colson" <p...@pc-ss.co.uk> wrote in message
> news:3db9287a$1@newsgroups.borland.com...
> > In MS SQL Query Analyser I can type

> >   IF IS_MEMBER ('db_owner') = 1
> >   print 'Yes'
> >   else
> >   print 'No'

> > which returns 'Yes' or 'No'

> > How can I get to this from within Delphi?

Other Threads