I have an Access 2010 database which has two MakeTable queries. The associated filename to where it the query will make a table currently needs to be changed manually when moving the database between environments.
This recently caused an issue when the database went live as it was making the table against the test version in 开发者_运维问答the back end database.
We have library code which auto-relinks tables when a database moves between environments but is is possible to also change the 'File Name:' which the make table is looking for in vba code?
Any help would be much appreciated.
You can edit queries from code like this:
Currentdb.QueryDefs("YourMakeTableQuery").SQL = "INSERT NEW QUERY HERE"
I don't know how your current query looks, but you just have to rebuild it here and insert the correct database path.
精彩评论