I have an old Access 2003 database that I'm having some trouble with. I'm trying to create some code that will allow users to toggle some specific linked tables between two Access database (essentially, they are switching between connecting these tables to current data and archived data). I've created the relatively simple code below that toggles the links for a specific list of tables between the two databases, which works fine for me. But when I try it with regular user permissions, I get an error at the RefreshLink stage that says "Could not create; no modify design permission for table or query 'TMP%#MAU@'" Below is the code:
I don't have a table or query named "TMP%#MAU@". In the searching I've done, I've found other people hitting similar issues, it appears to be an internal table that is used when creating links. It clearly seems to be a permissions issue. I have tried temporarily giving the standard users full access (modify design and administer) on the related tables in both backend databases, and in the front end links. I've found some similar issues in some old threads searching online. I can't post links, but I found one reply that said:
All of those seem to be basic open/read permissions that would be required for the database to even be usable, except for DbSecCreate.
And on another site:
As far as I can find, DbSecCreate can only be set via code, not via the GUI. So I've used the following code to set that permission to the pertinent group:
It compiles fine, it seems to run, but it doesn't fix the issue. I'm not even sure how to check to see if the permissions have been changed. If I add "debug.print ctr.Permissions" to my above code to edit permissions, it just returns 0, even after the "ctr.Permissions = ctr.Permissions And dbSecCreate" line, so maybe my code for adding those permissions is incorrect.
I'm really stumped here. Does anyone have any suggestions?
Thanks!
Code:
Public Sub SwitchArchive()
Dim db As Database
Set db = CurrentDb
Dim ConnectString As String
Dim ArchTblName As Variant
Dim ArchTblList(0 To 8) As String
If db.TableDefs("TraneCommJobs").Connect = ";DATABASE=\\alt-tv-file1\Dbase\GATRANE\GeneralData.mdb" Then
ConnectString = ";DATABASE=\\alt-tv-file1\Dbase\GATRANE\Archive.mdb"
Else
ConnectString = ";DATABASE=\\alt-tv-file1\Dbase\GATRANE\GeneralData.mdb"
End If
ArchTblList(0) = "TraneCommJobs"
ArchTblList(1) = "SO_Numbers"
ArchTblList(2) = "SO_Portions"
ArchTblList(3) = "SO_Lines"
ArchTblList(4) = "Serials"
ArchTblList(5) = "CreditJobShipAddr"
ArchTblList(6) = "AncLines"
ArchTblList(7) = "OrderStatusLetters"
ArchTblList(8) = "TraneCommJobSplits"
For Each ArchTblName In ArchTblList
db.TableDefs(ArchTblName).Connect = ConnectString
db.TableDefs(ArchTblName).RefreshLink
Next
Set db = Nothing
End Sub
I don't have a table or query named "TMP%#MAU@". In the searching I've done, I've found other people hitting similar issues, it appears to be an internal table that is used when creating links. It clearly seems to be a permissions issue. I have tried temporarily giving the standard users full access (modify design and administer) on the related tables in both backend databases, and in the front end links. I've found some similar issues in some old threads searching online. I can't post links, but I found one reply that said:
These are the minimum permissions necessary for both the front end and the
back end when refreshing links:
Front end:
DbSecCreate
DbSecReadDef
DbSecRetrieveData
Back end:
DbSecDBOpen
DbSecRetrieveData
All of those seem to be basic open/read permissions that would be required for the database to even be usable, except for DbSecCreate.
And on another site:
Code:
Follow up:
After some intensive searching I discovered that my user 'owner' needs
dbSecCreate permission on his 'Table' Container to avoid this error. This
permission option doesn't show in the GUI when setting permissions. It took
some digging to find it in code, but all is good now.
As far as I can find, DbSecCreate can only be set via code, not via the GUI. So I've used the following code to set that permission to the pertinent group:
Code:
Sub Add_DBSecCreate()
Dim dbs As Database, ctr As Container, strSystemDatabase
strSystemDatabase = DBEngine.SystemDB
Set dbs = DBEngine(0).OpenDatabase(strSystemDatabase)
Set ctr = dbs.Containers!Databases ' (I also tried dbs.Containers!Tables)
ctr.UserName = "GeneralUser"
ctr.Permissions = ctr.Permissions And dbSecCreate
End Sub
It compiles fine, it seems to run, but it doesn't fix the issue. I'm not even sure how to check to see if the permissions have been changed. If I add "debug.print ctr.Permissions" to my above code to edit permissions, it just returns 0, even after the "ctr.Permissions = ctr.Permissions And dbSecCreate" line, so maybe my code for adding those permissions is incorrect.
I'm really stumped here. Does anyone have any suggestions?

Thanks!