Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2002
    Posts
    5

    Unhappy Unanswered: Export with schema.ini file

    This is the first time I'm trying to use the schema.ini file and I can't get this to work for the life of me. Here is a simple example which I can't get to work. I am using the command:

    DoCmd.TransferText acExportDelim, "Export.txt", "ztest", "c:\temp\temp2\Export.txt", False, ""

    I have created a file called Schema.ini and put it into c:\temp\temp2. It contains the following:

    [Export.txt]

    ColNameHeader=True

    Format=TabDelimited

    DateTimeFormat=mm.dd.yy.hh.mm.ss

    When I run the TransferText I get the error "The text file specification 'Export.txt' does not exist. You cannot import, export, or link using the specification." Any Ideas?

  2. #2
    Join Date
    Sep 2002
    Posts
    9

    Thumbs up

    Here is the solution

    DoCmd.TransferText acExportDelim, "Export.txt", "ztest", "c:\temp\temp2\Export.txt", False, ""


    The correct syntax for exporting a table to a text file is as follows

    DoCmd.TransferText [transfertype][, specificationname], tablename, filename[, hasfieldnames][, HTMLtablename][, codepage]

    I am assuming that the table or query you wish to export is "Ztest" and that the file you wish to export it to is export.txt. I am also assuming that you are not using any specification. Type this code as is and let me know if it works.

    DoCmd.TransferText acExportDelim, ,"ztest", "C:\temp\temp2\export.txt"

    Please make sure that all of the above code is on the same line. Also note the double ,, after the word acExportDelim the extra "," lets the program know that there is no specification.

    If this does not work please let me know.

  3. #3
    Join Date
    Sep 2002
    Posts
    5
    Actually I want to use an export specification file. Reading all the help files it says the the file must be called Schema.ini and then it must contain the name of your export file. I created the schema.ini file and put in some basic stuff to see if that would work but that gives me the does not exist error. See my first message for the schema.ini contents.
    Last edited by TTML; 09-27-02 at 20:06.

  4. #4
    Join Date
    Sep 2002
    Posts
    9
    Do you want to export the file or import it?

  5. #5
    Join Date
    Sep 2002
    Posts
    5
    I want to export the file. Any ideas?
    Last edited by TTML; 09-30-02 at 16:41.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •