Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005
    Posts
    2

    Exclamation Unanswered: Cannot import dBase IV file with name longer that 8 char

    Hello all,
    A friend told me that this is a great forum so i came here with a problem hooping to find some help.

    This is my problem: I try to import some dBase IV file into MS ACCESS using DoCmd.TransferDatabase. It's work fine and quik for me except dBase files with name longer then 8 chars. I use this syntax:

    DoCmd.TransferDatabase acImport, "dBase IV", "F:\", Table, "name of the dbase file", "name of the table"

    The error recived when i try to import a file with the name longer that 8 chars is "The microsoft Jet cannot find the object xxxx". If i rename the file with a shorter name it work, but i must have the tables in may database with the same name that the files and i cant change the name of the files.

    Anybody have any ideea...

    Best regards,
    Robert Ion

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    i have to go out now and i've not heard of this particular Gates-ism, but a possible workaround scam.

    you already have a mechanism for determining the filename.
    store the original filename in a var

    check the source directory for a filename '§.dbf' (or something else absurd)
    loop adding more § (or other absurd character) until you find a filename that does not exist in the directory
    if more than 8 chars, try again with a different absurd character until you find an 8 char filename that does not exist in the directory.

    rename the file to the '§§§.dbf' or whatever mess that does not exist
    import
    rename the import in access to original name from the var
    rename the source file to its original name from the var

    ...and that is really really ugly, but it might work!

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Dec 2005
    Posts
    2
    Thanks izyrider,

    It is a ugly way to rezolve a problem but it works...(because the name of the file is shorter that 8 ).
    I find a little faster way...after i look for a file that does not exist, i rename the dbf that i want to import. The trick is that i import the file with the original name (longer that 8) and after import i just rename the dbf file to the original name.

    After that it became clear, DoCmd.TransferDatabase have a limitation only for the name of the file you want to import, not for the destination table.
    I cant remember how you refer to a file with name longer that 8 chars in DOS. Or a directory...
    Please try this: run [system]\system32\command.com and try to use the command CD to go into a directory with a name longer that 8 chars. It does not work ..but i remember that it was a trik to work...Maybe the same trik can be used for DoCmd.TransferDatabase

    Best regards

Posting Permissions

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