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