I have an Access database and the source of data comes from generated CSV files. I'd like to have an easy way for the users to simply select the data file and import it. Import should append the existing data to the data already in the data table. Is there a way in Access to create a file selector and import using saved CSV import settings that are already in the file?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can use the built in file dialog to do this (access 2003 and later)
Dim f As Object
Set f = FileDialog(3)
f.InitialFileName = "c:\InCommingData\"
f.Filters.Add "text", "*.csv"
If f.Show Then
DoCmd.TransferText acImportDelim, "mySpec", "Your Table", f.SelectedItems(1)
End If
回答2:
This seems to work. How to use the Common Dialog API in a database in Access 2003 or Access 2007