Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2012
    Posts
    2

    Unanswered: Security Levels - GetUser()

    Hi,

    I went to the DBForums Code Bank and looked into the Getuser() sample to apply the same type of permissions to my own database. However, I'm getting an error when I open up the "GetUser" form.

    Compile Error:
    User-defined type not defined

    Code:
    Function retFullName() As String
    Dim strSQL As String
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    strSQL = "Select * from dbo_AdminTable where LoginID = '" & GetUser() & "'"
    rs.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockReadOnly
    If rs.EOF And rs.BOF Then
        retFullName = "Name Not Found"
    Else
        retFullName = rs!FirstName & " " & rs!LastName
    End If
    rs.Close
    Set rs = Nothing
    End Function
    My user name is able to fill in correctly, however the "Your Name", "Security Level", and "Security Description" is getting an error.

    I've added the following to my database:

    1) dbo_AdminTable
    2) dbo_LookupSecurity
    3) Query1
    4) GetUser - Form
    5) Admin Functions - Modules
    6) Display Window Code - Module
    7) FormInfo - Module
    8) SystemInfo - Module
    9) UserName (GetUser) - Module

    I've updated the events on my form and checked all the properties.

    Am I missing something else?

    Your help is greatly appreciated.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    have you defined the function getuser()
    and is it declared as public
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2012
    Posts
    2
    I had to go and set my Microsoft ActiveX Data Objects 2.x Library references.

    Thank you guys.

Posting Permissions

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