Results 1 to 7 of 7

Thread: ADOX - User setup

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Posts
    161

    Question

    Hello !

    Does anyone have examples of how to setup users with specific rights when building a database with the ADOX objects ?

    Code:
    Dim usr As ADOX.User
    Set usr = New ADOX.User
    usr.Name = "ADMINISTARTOR"
    usr.SetPermissions "?????", adPermObjDatabase, adAccessSet, adRightFull
    Where I wrote question marks is where I get lost... the help files tels you it has to be the object name the rights will be granted to. I tried, the table object, or the catalog object I am using, nothing works...

    Any leads, anyone ?

    Thanks !

  2. #2
    Hyperactive Member compuGEEK's Avatar
    Join Date
    May 1999
    Location
    Mpls,MN,USA
    Posts
    281
    hi,

    Try adding the ADOX catalog object:

    dim clog as new ADOX.catalog

    and then:

    clog.Users("admin").SetPermissions "table", adPermObjTable,
    adAccessSet, adRightFull

    It should work....

    ooops, almost forgot...Be sure to set
    clog equal to your connection object like this:

    Set clog.ActiveConnection = YOUR CONNECTION OBJECT HERE

    [Edited by compuGEEK on 10-06-2000 at 04:32 PM]

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Posts
    161
    Thanks !

    I'll try some more stuff along those lines. Let me ask you though, what is 'table' in the line you have:

    clog.Users("admin").SetPermissions "table", adPermObjTable,
    adAccessSet, adRightFull

    Is it the table name you set rights to ? Or is it an object type, like table, database or maybe column... ?

    Thanks again !


  4. #4
    Hyperactive Member compuGEEK's Avatar
    Join Date
    May 1999
    Location
    Mpls,MN,USA
    Posts
    281
    Hi Francis,

    "table" is the name of the table that
    I am referencing.

    Sorry for the confusion!

    CGeek

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Posts
    161

    Question

    Thanks again, but... it still won't work.

    Here's the error I get:
    Object or provider is not capable of performing requested operation. (Number 3251)

    I am following the Microsoft ADO help with the same provider (Jet 4.0).... what can I do ?

  6. #6
    Hyperactive Member compuGEEK's Avatar
    Join Date
    May 1999
    Location
    Mpls,MN,USA
    Posts
    281
    What does your connection string look like?

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Posts
    161

    Post

    This is one thing I tried...

    Code:
    Private Sub cmdSetRights_Click()
    Dim clog As New ADOX.Catalog
    Dim cn As New ADODB.Connection
    
    cn.Provider = "Microsoft.Jet.OLEDB.4.0"
    cn.Open "data source=c:\temp\test.mdb;jet oledb:system database=mysystem.mdb"
    
    Set clog.ActiveConnection = cn
    
    clog.Users("user1").SetPermissions "CHROMATIC_DISPERSION", adPermObjTable, adAccessSet, adRightFull
    
    End Sub
    In the call to the Open method, I've also tried without the "jet oledb:system database=mysystem.mdb", which I am not really sure what it is...

    As you see this is independently under a command button. I've also tried at the same time as I create my database...

    Thanks again...

Posting Permissions

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



Click Here to Expand Forum to Full Width