开发者

How to amend a "MakeTable" queries properties in code -

开发者 https://www.devze.com 2023-03-24 02:18 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消