-
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..
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks