我有一个充当用户界面的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"
因此,表“Table”具有来自用户选择的外部MS Access数据库的数据 . 我想知道是否有一种简单的方法将数据直接导入SQL Server表 . 我试图将“表”名称更改为链接的SQL Server表,但它只是将其导入到名为相同的本地表中,后面带有“_1” .
1 回答
我认为你可以通过执行“追加查询”来做你想做的事 .
我不确定名称,因此在此示例中,[Table]是包含源数据的本机Access表,[SQL Server Table]是指向服务器上目标表的链接 .