Dirk Horsten
Dirk Horsten

Reputation: 3845

How to connect to a semicolumn separated CSV file form ms-access

What do I need to add to

DoCmd.TransferText acLinkDelim, tableName:="myLinkedTableName", _
    fileName:="c:\myFolder\myFile.csv", _
    HasFieldNames:=True

if the fields in c:\myFolder\myFile.csv are separated by ;?

If DoCmd.TransferText does not have such option, is there an alternative way to connect to a file as table programatically?

Upvotes: 0

Views: 112

Answers (1)

Gustav
Gustav

Reputation: 55806

Link the file manually using the wizard. Specify the separator as semicolon.

Save the import specification. Remove the link.

Now, specify the import specification to use when creating a new link:

DoCmd.TransferText acLinkDelim, tableName:="myLinkedTableName", _
    fileName:="c:\myFolder\myFile.csv", _
    HasFieldNames:=True, _
    SpecificationName:=YourImportSpecification

Upvotes: 1

Related Questions