Object Level Security 
Author Message
 Object Level Security

Currently I am trying to implement object level security in Visual Basic.
I am storing the object names in which I am trying enable or disable based
on an associated security level.   When performing a query on a name in a DB
I receive back a string.   I would like to take that string and perform
property settings on it as if it was the object.
For Example.

'minus the db stuff
dim sVal as string
sVal = "command1"  'an example object
sVal.Enabled = False ' not a valid statement but gives the essence of what I
am trying to do.

I have also tried using an object of type varient but that does not work
either.  Once it receives the string from the database it emulates a string.
Additionally I have tried defining an object of type Object and that does
not work either it wont accept a string as its value.

So any ideas would be greatly appreciated.



Mon, 13 May 2002 03:00:00 GMT  
 Object Level Security

Quote:
>'minus the db stuff
>dim sVal as string
>sVal = "command1"  'an example object
>sVal.Enabled = False ' not a valid statement but gives the essence of what I
>am trying to do.

Dim objControl      As Object
Dim strControl      As String
Dim i                   As Long

For i = 1 to 3
  strControl = "cmdDynamic" & CStr(i)
  Set objControl = Controls(strControl)
  objControl.Enabled = False
  Set objControl = Nothing
Next i

Set up a form with three command buttons named "cmdDynamic1" -
"cmdDynamic3"...then run the code above.  You should be able to adapt this to
whatever you need.  ;)

-Curtis Spendlove
-Solstice Software



Mon, 13 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Remote Data Objects in combination with level 1 compliance level

2. Object security (DCOMCFG, Component Services, Security, VB6, Installation)

3. OpenDataSource name argument and user-level security

4. User-level security & OpenDataSource name argument

5. Security - User Level

6. change macro security level with VBA

7. User-Level Security problem

8. Modifying Attachment Security Levels

9. Changing Security Level via VBA?

10. Security Levels

11. Security Level

12. enabling security level setting

 

 
Powered by phpBB® Forum Software