Brad Mathews
Brad Mathews

Reputation: 1857

My schema.ini file is being ignored when using DoCmd.TransferText() from .Net

My schema.ini file is being ignored.I get the same results whether I have a scheme.ini file in the same folder as my tab file or not. All of the columns end up in a single column. I am trying to use a schema.ini as I am importing tab delimited files. The results make perfect sense if it is trying to import a comma delim file.

So my postulate is that the schema.ini file is just being ignored.

I am running Access from a .Net program using Microsoft Access 14.0 Object.Library.

I am using this command from .net:

Access.DoCmd.TransferText( Microsoft.Office.Interop.Access.AcTextTransferType.acImportDelim, , TableName, TabFile, HasFieldNames)

Here is my schema.ini file, not that it matters since it is being completely ignored:

[impacts.txt]
Format=TabDelimited
ColNameHeader=True
MaxScanRows=0

Clues? Thanks!

EDIT: I tried running this from within an Access Module with the same results.

I tried editing the registry to change the Format value there. Same results.

Upvotes: 0

Views: 1127

Answers (1)

Parfait
Parfait

Reputation: 107587

Consider an action query, either append or make-table, as the use of schema.ini files can work directly in an Access query of a text file. Below assumes .ini file is in same directory as text file.

INSERT INTO mytableName
SELECT * FROM [text;Database=C:\Path\To\Text\File].[impacts.txt]

SELECT * INTO newtableName FROM [text;Database=C:\Path\To\Text\File].[impacts.txt]

Upvotes: 3

Related Questions