First Row Contains Field Names

C

COTA

Is there a way to control how the first row of a linked file is handled
using DAO? When I connect to a file using the Link Text Wizzard the "First
Row Contains Field Names" is unchecked. This results in generic column
names. When I attempt to connect to the same file using DAO the first data
row is used as column names. I would like to control this behavior. Any
advice would be appreciated. Thanks.

For what it's worth here's an example of the code I'm using.

Dim db As Database
Dim tdf As TableDef
Set db = CurrentDb
Set tdf = db.CreateTableDef("TestTable")
tdf.SourceTableName = "TestData.csv"
tdf.Connect = "text;database=j:\TestDir\"
db.TableDefs.Append tdf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top