I am using the following code to link .csv files into an Access database.
I need to convert these to Access tables. How would I do this?
The reason I used this approach would be to side step an import specification
Should I just be doing an import as a table
Dim appAccess As New Microsoft.Office.Interop.Access.Application
appAccess.OpenCurrentDatabase("C:\Users\murbro\Documents\Database1.accdb")
appAccess.Visible = True
'Link to a csv file so that it acts as a table in Access
appAccess.DoCmd.TransferText(TransferType:=Microsoft.Office.Interop.Access.AcTextTransferType.acLinkDelim, TableName:="Orders", _
FileName:="C:\Users\murbro\Documents\Orders.txt", HasFieldNames:=True)
Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.
However with a linked file, you can
- open Access
- Copy the linked table/file
- Paste it
- Select the option to make a local table when you paste it