If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > set user and groups permissions in access

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-07-02, 04:49
Tim G Tim G is offline
Registered User
 
Join Date: Dec 2001
Location: Belgium
Posts: 6
Red face set user and groups permissions in access

When I want to know if a certain table is in a database, I have to access the system table MsysObjects. This table is set to be having no read permissions. In access you can change these permissions in "Tool - Security ..." But how can I change this in a VB-program?
Reply With Quote
  #2 (permalink)  
Old 03-08-02, 07:52
annavp annavp is offline
Registered User
 
Join Date: Feb 2002
Location: Leuven, Belgium
Posts: 27
I wouldn't query the system table. Access has it's own tools to list tables and change their properties. The example below is a procedure I use to reconnect Linked tables to a database which path is passed to the function. You need to add a reference to microsoft ADO ext. 2.5 for DDL and security.

Public Sub LinkTables(strConnect As String)

Dim catTables As New ADOX.Catalog
Dim tblTable As New ADOX.Table

On Error GoTo ErrorHandler

Set catTables.ActiveConnection = CurrentProject.Connection

For Each tblTable In catTables.Tables
If tblTable.Type = "LINK" Then
tblTable.Properties("Jet OLEDB:Link Datasource").Value = strConnect
tblTable.Properties("Jet OLEDB:Table Hidden In Access").Value = True
End If
Next tblTable

Set catTables = Nothing
Set tblTable = Nothing
Set rstParameter = Nothing

Exit Sub
ErrorHandler:
msgbox "Error: " err.description
DoCmd.Quit
End Sub

If you need more info
let me know

anna
Reply With Quote
  #3 (permalink)  
Old 03-08-02, 08:07
Tim G Tim G is offline
Registered User
 
Join Date: Dec 2001
Location: Belgium
Posts: 6
Thumbs up

Thanks for the help, Anna...

I knew it was possible to acces a tablename with ADOX.
I used following code :

cat.ActiveConnection = currentConnection
For i = 0 To cat.Tables.Count - 1
If cat.Tables(i) = "SearchedTableName" Then ....
....

But for some strange reason I don't want to use ADOX, and I'm curious if it's possible with ADODB.
Reply With Quote
  #4 (permalink)  
Old 03-08-02, 09:13
annavp annavp is offline
Registered User
 
Join Date: Feb 2002
Location: Leuven, Belgium
Posts: 27
To tell you the truth, I have given up searching for a solution in ADODB. I haven't found any way to refer to a table and change in properties using ADO.

If you find a solution, let me know!!!

anna
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On