【发布时间】:2015-06-02 19:21:07
【问题描述】:
我有一个充当用户界面的 Access 数据库。 我在 Access 数据库中有一个链接的 SQL Server 2008 表。在用户界面上有用户选择的各种过滤器/标准(例如日期、外部 MS Access 数据库等。 这些都用于导入数据库。现在,我正在将用户选择的外部 MS Access 数据库导入到用户界面上的内部表中。 我的目标是将这些数据直接导入到 SQL 服务器表中。 这可能吗?
这就是我现在的做法。
Dim Select_File as string
Dim varFile as Variant
Dim DBMonth as String
DBMonth = Me.Month.Value '<-- this is just the Month that is either Default to current month of what user selects in a combobox on user interface
' there is some code here that has the user select the external access database and varFile is = .SelectedItems
Select_File = varFile
DoCmd.TransferDatabase acImport, "Microsoft Access", Select_File, acTable, "Table_" & DBMonth & "_All", "Table"
因此,“表”表包含用户选择的外部 MS Access 数据库中的数据。 我想知道是否有一种简单的方法可以将该数据直接导入 SQL Server 表。 我试图将“表”名称更改为链接的 SQL Server 表,但它只是将其导入到一个名称相同的本地表中,并在其后加上“_1”。
【问题讨论】:
标签: ms-access vba ms-access-2010