Checking for links at startup to backend tables with all permissions revoked

  • Thread starter robert demo via AccessMonster.com
  • Start date
R

robert demo via AccessMonster.com

I'm trying to check the links to tables in a backend where I have for
security reasons revoked all permissions on the tables.

I'm using the following code (I've left out variable definitions and the
error handler code). strTableName is passed into the function and is the
name of the table that I'm checking for a link.

'Link to the current database
Set dbs = CurrentDb

'Extract connect string
If Len(strTableName) > 0 Then
Set tdf = dbs.TableDefs(strTableName)
End If
strTemp = tdf.Connect

'See if the connect string is valid
Set rst = tdf.OpenRecordset
lngRecordCount = rst.RecordCount


The error occurs on trying to set the recordset, i.e.

Set rst = tdf.OpenRecordset

and the error is #3112

"Records cannot be read, no read permission on table 'strTableName'"

Okay, so this is perhaps not unexpected. Is there another way I can test
the link or is having a valid tdf.Connect enough.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top