Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2009
    Posts
    79

    Unanswered: Restrict / Provide access to users to a macro through a sql database list.

    Hi All,

    I have macro with a userform which extracts some data from a sql database based on the parameters selected in it. i have circulated this macro to my team members now i want a macro code which will check a list which is maintained by me in a form of table in a sql database and allow the user to use that macro only when his name / xp id is updated in that list. For eg :

    Sub CheckAccess()
    myusername = Environ("username")
    If myusername <> mydatabase Then
    'now i want a code which should check the existence of his xp user id in my sql database table if it doesn't exist in that table then should show following message.
    MsgBox "Not an Authorized User"
    End if
    End Sub

    Thanks a lot your help in advance.

  2. #2
    Join Date
    Sep 2009
    Posts
    79
    Hi All,

    I have macro with a userform which extracts some data from a sql database based on the parameters selected in it. i have circulated this macro to my team members now i want a macro code which will check a list which is maintained by me in a form of table in a sql database and allow the user to use that macro only when his name / xp id is updated in that list. For eg :

    Sub CheckAccess()
    myusername = Environ("username")
    If myusername <> mydatabase Then
    'now i want a code which should check the existence of his xp user id in my sql database table if it doesn't exist in that table then should show following message.
    MsgBox "Not an Authorized User"
    End if
    End Sub

    Thanks a lot your help in advance.

  3. #3
    Join Date
    Sep 2009
    Posts
    79
    test data for check
    Quote Originally Posted by abhay_547 View Post
    Hi All,

    I have macro with a userform which extracts some data from a sql database based on the parameters selected in it. i have circulated this macro to my team members now i want a macro code which will check a list which is maintained by me in a form of table in a sql database and allow the user to use that macro only when his name / xp id is updated in that list. For eg :

    Sub CheckAccess()
    myusername = Environ("username")
    If myusername <> mydatabase Then
    'now i want a code which should check the existence of his xp user id in my sql database table if it doesn't exist in that table then should show following message.
    MsgBox "Not an Authorized User"
    End if
    End Sub

    Thanks a lot your help in advance.
    Last edited by abhay_547; 05-06-11 at 14:37.

  4. #4
    Join Date
    Sep 2009
    Posts
    79
    Quote Originally Posted by abhay_547 View Post
    test data for check
    pls find the test data
    Last edited by abhay_547; 05-23-11 at 14:08.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •