Results 1 to 9 of 9
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Auto Importing Dbase IV Files ((2000 (9.0.4402 SR-1)))

    Don't include the extension in the table name:

    DoCmd.TransferDatabase acImport, "DBase IV", "C:Temp", acTable, "SPRULES", "SPRULES"

  2. #2
    3 Star Lounger
    Join Date
    Nov 2003
    Location
    London, Gtr London, England
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto Importing Dbase IV Files ((2000 (9.0.4402 SR-1)))

    Edited by HansV to provide link to post - see <!help=19>Help 19<!/help>

    I'm having a problem importing the above either via a macro or VB. I have followed the threads of DaleNapier from <post#=167409>post 167409</post#> onwards, copied his DB etc and tried the proposed solution, but if I do the following:-
    DoCmd.TransferDatabase acImport, "DBase IV", "c:temp", acTable, "SPRULES.dbf", "SPRULES"
    I get the message "The Microsoft Jet Database engine could not find the object 'SPRULES.dbf'. Make sure the object exists and that you spell its name and the path correctly."

    I also get the same message if I add the path to the source filename. i.e.
    DoCmd.TransferDatabase acImport, "DBase IV", "c:temp", acTable, "c:tempSPRULES.dbf", "SPRULES"

    Any thoughts as to where I'm going wrong?

    Cheers,

    Niven

  3. #3
    3 Star Lounger
    Join Date
    Nov 2003
    Location
    London, Gtr London, England
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Importing Dbase IV Files ((2000 (9.0.4402 SR-1)))

    Aaaaaaaaaaargh!

    Had tried it without the file extension, but to no avail. Looked at it again this morning to see that the person who supplied the file included a space at the end of the filename before the .dbf and der brain here didn't see it!

    Many thanks for your time,

    Niven

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Auto Importing Dbase IV Files ((2000 (9.0.4402 SR-1)))

    Glad you found it - such things are easily overlooked.

  5. #5
    3 Star Lounger
    Join Date
    Nov 2003
    Location
    London, Gtr London, England
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Importing Dbase IV Files ((2000 (9.0.4402 SR-1)))

    Just when you thought it was safe to go back into the water.......................

    Have moved the import from my local drive to a network drive and am getting

    Run-time error '3125':

    " is not a valid filename. Make sure that it does not include invalid characters or punctuation and that it is not too long.

    I've tried placing the file in several different drives and under the simplest setting i.e. "Q:" and get the same response each time.

    Is there something else I need to do here? I don't have this problem with text files, which is the normal import medium I work with.

    Cheers,

    Niven

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Auto Importing Dbase IV Files ((2000 (9.0.4402 SR-1)))

    It shouldn't matter whether you import a DBase file from a folder on a local drive or from a network folder. Check very carefully that there are no typos.

    You can also test using a UNC path, i.e. a path of the form serversharefolder..., but again, it shouldn't matter whether you use a drive letter or a UNC path.

  7. #7
    3 Star Lounger
    Join Date
    Nov 2003
    Location
    London, Gtr London, England
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Importing Dbase IV Files ((2000 (9.0.4402 SR-1)))

    Hmmm!

    Have got it to work now as follows (probably pretty obvious!):-

    1) Whilst the space at the end of the filename wasn't a problem on the local drive, it is on the network drive.
    2) My text files import ok from folders which have spaces in the folder names i.e. "Q:dataweekly download files", but the Dbase files do not.

    The method I use for the text files is along the lines of :-
    DoCmd.TransferText acImportDelim, "MSCCReport Import Specification", "MSCCReport", origcsvfullpath, True, ""

    Where the "MSCCReport Import Specification" is the pre defined set of rules for the delimited file and the origcsvfullpath created from appending the full text file name (such as msccreport.txt) to the CurrentProject.Path, which in turn is derived from the CurrentProject.Connection.

    I'm assuming the TransferDatabase method isn't as forgiving (or is more disciplined) as my text file method when it comes to file imports.

    Cheers,

    Niven

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Auto Importing Dbase IV Files ((2000 (9.0.4402 SR-1)))

    The cause of the problem is that DBase is an MS-DOS application in origin; it doesn't "know" about the long names for files and folders allowed in recent Windows versions. It would probably work if you used the short MS-DOS name for the path and file ("weekly download files" would probably become WEEKLY~1)

  9. #9
    3 Star Lounger
    Join Date
    Nov 2003
    Location
    London, Gtr London, England
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Importing Dbase IV Files ((2000 (9.0.4402 SR-1)))

    Aha! Have tried a shorter folder name - Test and it works fine.

    Cheers again,

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

Posting Permissions

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