Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2001
    Location
    Belgium
    Posts
    6

    Red face Unanswered: 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?

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

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

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

Posting Permissions

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