Cotswold
Well-known member
- Local time
- Today, 11:34
- Joined
- Dec 31, 2020
- Messages
- 925
Hi, I have created a database in Acces2010, which is split Frontend & Backend. I have code that will disconnect
the linked tables and re-link them. I have this to allow the backend to be moved to another location if required.
Basicaly the linked tables are removed, the new path is located and the tables are re-attched. This has never been
a problem before but in this new database when the code runs it fails because some tables are related.
I have software developed in Access 2000 that I have amended to run in Access2010 and they work just fine. Some
with over 20 linked tables. After tables are removed and re-linked all of the relationships remain intact.
The new developed program will always fail due to Error Nº 2387
ErrMsg = "You can't delete the table "TableName" it is participating in one or more relationships"
I use this to remove the linked Table
DoCmd.DeleteObject acTable, "TableName"
I then normally re-link with the next line of code but use variables for the items in ""
DoCmd.TransferDatabase AcLink, "Microsoft Access", "PathAndBackendDatabase", acTable, "TableName", "TableName", 0
I have looked through OPTIONS but cannot see a switch. Document deletions are off. If the conversions from A2000 are Ok
I cannot see why the on in A2010 isn't. I know I can delete and add relationships but I don't really want to do that because I
can't check if they fail to create.
Maybe someone else has come across this before? I'll be upgrading to Access2019 soon but can't see that will fix the issue.
Regards,Cotswold
the linked tables and re-link them. I have this to allow the backend to be moved to another location if required.
Basicaly the linked tables are removed, the new path is located and the tables are re-attched. This has never been
a problem before but in this new database when the code runs it fails because some tables are related.
I have software developed in Access 2000 that I have amended to run in Access2010 and they work just fine. Some
with over 20 linked tables. After tables are removed and re-linked all of the relationships remain intact.
The new developed program will always fail due to Error Nº 2387
ErrMsg = "You can't delete the table "TableName" it is participating in one or more relationships"
I use this to remove the linked Table
DoCmd.DeleteObject acTable, "TableName"
I then normally re-link with the next line of code but use variables for the items in ""
DoCmd.TransferDatabase AcLink, "Microsoft Access", "PathAndBackendDatabase", acTable, "TableName", "TableName", 0
I have looked through OPTIONS but cannot see a switch. Document deletions are off. If the conversions from A2000 are Ok
I cannot see why the on in A2010 isn't. I know I can delete and add relationships but I don't really want to do that because I
can't check if they fail to create.
Maybe someone else has come across this before? I'll be upgrading to Access2019 soon but can't see that will fix the issue.
Regards,Cotswold