Following on from an issue a couple of years back, now archived:
http://www.thescripts.com/forum/thre...f.connect.html
I'm having the same problems.
I can update the Querydef.connect property programmatically without any problems, however if I try to update the Tabledef.connect property it won't do it, even though it runs through the code successfully.
When I try to manually update the connect column in MsysObjects it won't let me do it, gives a "Control Can't be Edited; It's Bound to Replication System Column Connect" message in the control bar, so I'm guessing this is related...
Any help on this would be appreciated.
FYI the code is below, and we do not use in-built Access database security on our Access dbs (could this be why it won't let me edit it through code?)
Expand|Select|Wrap|Line Numbers
- Dim db As DAO.Database
- Set db = CurrentDb
- 'Reset the connection property for all pass through queries for DB1 database only
- For Each QueryDef In db.QueryDefs
- If QueryDef.Connect Like "*DATABASE=DB1*" Then
- QueryDef.Properties("Connect") = gblConnectionString
- QueryDef.Properties.Refresh
- End If
- Next