Results 1 to 10 of 10
  1. #1
    Star Lounger
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto-importing dBase/Clipper files (Access 2000)

    I've read all I could find in earlier posts about importing dBase files, but what I do not see is the answer to the next question: How can I write VBA code to auto-import the files? I can't use my old favorite, TransferDatabase, or its kin. I looked at using RunCommand acCmdImport, but there appears no way to pass arguments -- namely, the table name. Instead, it opens up a file picker dialog box. I want complete automation; my routines will always import the same files. Help?!

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Auto-importing dBase/Clipper files (Access 2000)

    Why can't you use the TransferDatabase command?
    This is what I use all the time.
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  3. #3
    Star Lounger
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto-importing dBase/Clipper files (Access 2000)

    That was the first thing I tried. It kept hiccuping, saying that my "database name" contained an invalid path name -- which I made absolutely sure was valid, as well as the file name itself. I assumed that in place of a database name, I should use the dBase table name. Is that right? Can you give me an example of a command you use successfully for this, so I can be sure that I am handling it correctly? You've already helped a lot just by telling me you do this successfully. Even as I await your reply, I will go back to that effort. Thanks!

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Auto-importing dBase/Clipper files (Access 2000)

    Why don't you zip a dbase file (tell me what version of dbase it is) and I'll see what I can come up with. Even include your database.
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  5. #5
    Star Lounger
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto-importing dBase/Clipper files (Access 2000)

    Here are more details about my effort. I issue this command:

    DoCmd.TransferDatabase acImport, "dBase IV", "GevTrandlcs.dbf", acTable, "GevTrandlcs.dbf", "Trandlcs.dbf"

    I get this error message:

    Run-time error '3044': 'GevTrandlcs.dbf' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which it resides.

    I should mention that G: is a local, not network drive, and the path and file names are definitely valid; I've even experimented with different paths and file names, to no avail.

  6. #6
    Star Lounger
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto-importing dBase/Clipper files (Access 2000)

    OK, I did that. I stripped down the database to nothing but the module with the VBA code for doing the import, and the .DBF file in question. I was told it is a Clipper file, which typically means dBase III or IV; I tried both, with no apparent difference. Thanks for your assistance!
    Attached Files Attached Files

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Auto-importing dBase/Clipper files (Access 2000)

    Hi there
    I have tried the following and it seems to have worked.

    DoCmd.TransferDatabase acImport, "DBase IV", "cataAccess2000", acTable, "Trandlcs", "Trandlcs"

    Note the databasename is in fact the path only (so change cataAccess2000 to g:dev )

    HTH
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  8. #8
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Auto-importing dBase/Clipper files (Access 2000)

    The DatabaseName argument for TransferDatabase method in case of dBase files should indicate folder path only, as you note. According to "Help" file:
    <hr>DatabaseName

    The name of the database to import from, export to, or link to. Include the full path. This is a required argument.

    For types of databases that use separate files for each table, such as FoxPro, Paradox, and dBASE, enter the directory containing the file. Enter the file name in the Source argument (to import or link) or the Destination argument (to export).
    <hr>
    HTH

  9. #9
    Star Lounger
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto-importing dBase/Clipper files (Access 2000)

    Jeez, I so hate it when someone tells me something I should have easily discovered for myself! I am also relieved, though, because this was really bothering me. Again, I am humbled. Thank you!

    No one may know if I am a penguin, but now everyone knows I am a donkey ...

  10. #10
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Auto-importing dBase/Clipper files (Access 2000)

    Main reason I knew about this is from working with FoxPro tables (have never used dBase) which also use .DBF extension and work same way when importing, you specify path only for "DatabaseName". It's not exactly intuitive unless you read the fine print....
    MD
    Attached Images Attached Images

Posting Permissions

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