从不同数据库导入的语法 - MS Access [英] Syntax for Import Into from Different DBs - MS Access

查看:24
本文介绍了从不同数据库导入的语法 - MS Access的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试(基本上)从一个后端到另一个后端的自动行复制,因为后端正在使用但尚未完全开发(有些表已完成,有些则没有;将完成的数据添加到更高级的数据库中在一天结束时).

I'm trying to do (basically) an automated row copy from one backend to another as the backend is being used but is not fully developed (some tables are done, others not; adding the completed data into the more advanced db at the end of the day).

我想知道 SQL 语句的语法是什么:

I'd like to know what the syntax is for an SQL statement which:

INSERT INTO tblMyBetterTable * IN "C:\path_to_dbdb.accdb"
FROM tblMyTable IN "C:\path_to_in_use_dbin-use-db.accdb"

语法不正确,但我已经搜索了一段时间,无法找到如何.. 我已经看到如何从一个表导入到另一个表等,但不是跨后端.如果不清楚,我想基本上将 in-use-db.accdb 中的所有行从 tblMyTable 复制到后端的最新版本 db.accdb 的表 tblMyBetterTable.

The syntax is not correct but I've searched for a while and can't find out how.. I've seen how to import from one table to another etc, but not across backends. If it's not clear, I'd like to basically do a table copy of all rows in in-use-db.accdb from tblMyTable to the latest version of the backend db.accdb's table tblMyBetterTable.

推荐答案

建议你试试DoCmd.TransferDatabase

对于查询,您需要以下内容:

For a query, you need something on the lines of:

SELECT * INTO NewTable 
FROM [;DATABASE=Z:DocsTest.accdb].Table1

或者反过来:

SELECT * INTO [;DATABASE=Z:DocsTest.accdb].NewTable
FROM Table1

插入现有表:

INSERT INTO table1 
SELECT * 
FROM [;DATABASE=Z:DocsTest.accdb].Table1

这篇关于从不同数据库导入的语法 - MS Access的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆