Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Modify Read Permission on Multiple Databases

Avatar of Malik1947
Malik1947 asked on
Microsoft Access
5 Comments1 Solution1549 ViewsLast Modified:
I am trying to retrieve and catalog the objects that reside on a list of 115 Access Databases to eliminate duplicates and give certain users access to certain objects in certain databases.

I wrote the code attached to achieve this.

My code iterates through the list of 115 databases (they reside on different network sources and drives) and then opens each one of them and tries to retrieve the object information.

My problem is that when ever I try to access that table on each individual database it returns an error.
'Record(s) cannot be read; no read permission on 'MSysObjects'

I know that if I go into each individual database and give the Admin user read rights to that table then it works but I do not want to go through this 115 times. I am hoping someone knows a different way to do this.

any help will be appreciated.
accConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;user id=Admin;Data Source=" & dbPath & "\" & dbName
    
    strSQL = "SELECT "
    strSQL = strSQL & "MSysObjects.Name, "
    strSQL = strSQL & "MSysObjects.ForeignName, "
    strSQL = strSQL & "MSysObjects.Type, "
    strSQL = strSQL & "MSysObjects.DateCreate, "
    strSQL = strSQL & "MSysObjects.DateUpdate "
    strSQL = strSQL & "FROM "
    strSQL = strSQL & "MSysObjects "
    strSQL = strSQL & "WHERE "
    strSQL = strSQL & "(((MSysObjects.Type)=1 Or "
    strSQL = strSQL & "(MSysObjects.Type)=4 Or "
    strSQL = strSQL & "(MSysObjects.Type)=5 Or "
    strSQL = strSQL & "(MSysObjects.Type)=-32761 Or "
    strSQL = strSQL & "(MSysObjects.Type)=-32764 Or "
    strSQL = strSQL & "(MSysObjects.Type)=-32768));"
    
    accObjRS.Open strSQL, accConn, adOpenForwardOnly
ASKER CERTIFIED SOLUTION
Avatar of Malik1947
Malik1947

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answers