PDA

Click to See Complete Forum and Search --> : ADOX - User setup


FrancisC
Oct 6th, 2000, 02:25 PM
Hello !

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


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 !

compuGEEK
Oct 6th, 2000, 03:24 PM
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]

FrancisC
Oct 6th, 2000, 04:53 PM
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 !

compuGEEK
Oct 9th, 2000, 11:29 AM
Hi Francis,

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

Sorry for the confusion!

CGeek

FrancisC
Oct 9th, 2000, 12:03 PM
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 ?

compuGEEK
Oct 9th, 2000, 04:37 PM
What does your connection string look like?

FrancisC
Oct 10th, 2000, 06:53 AM
This is one thing I tried...


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...