Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Use .ini File for TransferText??

Status
Not open for further replies.

KellyStee

Technical User
Jul 30, 2001
106
US
I'm trying to import a text file using a schema.ini file. Everything works except when I don't specify a specification before the second comma (see below), it uses the default import/export specification. If I put "schema.ini" there, it tells me the file doesn't exists, and if I put the full path and filename there, it takes out the "\" and tells me the file doesn't exist. I even tried using chr(92) and replaced the "\" and that doesn't work either. Any help would be greatly appreciated!!

My code so far is:

DoCmd.TransferText acImportDelim,, "Imported Data", glFileName
 
Actually, I figured out the answer to my own question because it was driving me nuts!! :eek:) It seems using a schema.ini file with the TransferText method is a known bug. Instead, Microsoft recommends using SQL:
Db.Execute "SELECT * INTO [Table Name] FROM [TEXT;DATABASE=[Path].[Filename]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top