Results 1 to 5 of 5

Thread: [RESOLVED] Access specification filetype for transfertext of CSVs

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    N42 29.340 W71 53.215
    Posts
    422

    Resolved [RESOLVED] Access specification filetype for transfertext of CSVs

    I'm trying to generate specifications files in Access automatically (in code) to handle different formats of CSV files.

    i.e. I read in the 1st line containing the column names and then create a new spec in the MSysIMEXSpecs & MSysIMEXColumns tables to force all fields to come in as text.

    It works fine except some files insist on a spec filetype in MSysIMEXSpecs of 1200 and others of 1252 and I can't figure out which wants what except by trial and error.
    Apparently, 1200 is for unicode and the 1252 is Latin something.

    Does anyone know if there's a way around this or if there's a way I can test the data file, via code, to see if it's unicode etc?

    Thanks, DaveBo
    "The wise man doesn't know all the answers, but he knows where to find them."
    VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15

  2. #2
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: Access specification filetype for transfertext of CSVs

    The FileType field in MSysIMEXSpecs table with Jet 4.0 and later is the code page to use.

    See full listing of codepages here: Character Set Recognition

    Beside that (not sure):
    0 = Windows (ANSI)
    1 = DOS or OS/2 (PC-8)

  3. #3
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Re: Access specification filetype for transfertext of CSVs

    I generally just manually import the .csv file first, and save the import spec there.
    I realize you want to do it in code, so maybe that doesn't help you, but this way you won't have these errors.
    Tengo mas preguntas que contestas

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    N42 29.340 W71 53.215
    Posts
    422

    Re: Access specification filetype for transfertext of CSVs

    Thanks, that's helpful. The CodePage field from that "Character Recognition" table seems to be what the specification FileType wants in it.

    Somehow, when doing a manual import and creating a spec from that it knows what value to use here. I was hoping I could do the same when creating my specs from code.

    The strange thing is, when I auto-generate the spec and import the file with my routine it looks like it worked, but if the FileType setting is wrong the new table is empty.

    Thanks, DaveBo
    "The wise man doesn't know all the answers, but he knows where to find them."
    VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15

  5. #5
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: Access specification filetype for transfertext of CSVs

    If that helps you and your problem has been solved, please use thread tools to mark this thread as RESOLVED and you should rate the post that helps you.

Posting Permissions

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



Click Here to Expand Forum to Full Width