SQLDMO Compability Help


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: SQLDMO Compability Help

  1. #1
    Oktur Guest

    SQLDMO Compability Help


    i have app with sqldmo.dll compiled when i upgrade the sqldmo.dll into
    sql server 2000 version, i met something weird.....

    here's the cut of my code :

    Set View = DatabaseObject.Views(myTable)
    Set SQLObjectList = View.ListUserPermissions(myUser)


    If CurrentUSER = "dbo" Then
    For iLoop = 1 To 4
    lblPermission(iLoop).Enabled = True
    If CurrentPermissionType Then
    Picture1(iLoop).Visible = True
    ElseIf iLoop < 2 Then
    Picture1(iLoop).Visible = True
    End If
    Next iLoop
    Else
    FinalPermission = 0
    For Each Permission In SQLObjectList --> here's the problem
    If Permission.Granted Then
    FinalPermission = Permission.PrivilegeType
    Select Case FinalPermission
    Case SQLDMOPriv_Select
    Case SQLDMOPriv_Update
    Case SQLDMOPriv_Insert
    Case SQLDMOPriv_Delete
    End Select
    End If
    Next
    End If

    when i trace the coding, i give myuser all rights then when the sqlobjectlist
    read the right only just select and update right detected

    i dont know how & why . . . . . . .

    perhaps you can help me. ....


    Best Regards..


  2. #2
    Q*bert Guest

    Re: SQLDMO Compability Help


    If I understand the question correctly, your trying to get a set grant the
    permissions of (Select, Update, Delete, and Insert) on a table to a user
    in your user list. However, the code you have is not working correctly.

    If I'm reading this code right, it appears you have an object(SQLObjectList)
    of all your CURRENTLY SET user permissions for a GIVEN Table and a given
    user. When you cycle through the permissions on the object, your only going
    to see the status of permissions for the given object as associated to that
    user.

    Your IF statement says, if they have granted access then do the evaluations.
    This if statement will only activate on permissions they already have.
    If your trying to give them permissions to items they don't have you need
    to "not" your if statement.

    Just my thought...
    However, I am a little unclear on your need/want and current functionality.


    "Oktur" <oktur@erakomp.com> wrote:
    >
    >i have app with sqldmo.dll compiled when i upgrade the sqldmo.dll into
    >sql server 2000 version, i met something weird.....
    >
    >here's the cut of my code :
    >
    >Set View = DatabaseObject.Views(myTable)
    >Set SQLObjectList = View.ListUserPermissions(myUser)
    >
    >
    > If CurrentUSER = "dbo" Then
    > For iLoop = 1 To 4
    > lblPermission(iLoop).Enabled = True
    > If CurrentPermissionType Then
    > Picture1(iLoop).Visible = True
    > ElseIf iLoop < 2 Then
    > Picture1(iLoop).Visible = True
    > End If
    > Next iLoop
    > Else
    > FinalPermission = 0
    > For Each Permission In SQLObjectList --> here's the problem
    > If Permission.Granted Then
    > FinalPermission = Permission.PrivilegeType
    > Select Case FinalPermission
    > Case SQLDMOPriv_Select
    > Case SQLDMOPriv_Update
    > Case SQLDMOPriv_Insert
    > Case SQLDMOPriv_Delete
    > End Select
    > End If
    > Next
    > End If
    >
    >when i trace the coding, i give myuser all rights then when the sqlobjectlist
    >read the right only just select and update right detected
    >
    >i dont know how & why . . . . . . .
    >
    >perhaps you can help me. ....
    >
    >
    >Best Regards..
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center