Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820

    Unanswered: Why don't this code work?

    DAO.DBEngine.CompactDatabase "J:\MICHAEL TIMONEY\com.mdb", "J:\MICHAEL TIMONEY\com2.mdb"


    i get error 3055 'not a valid file name'
    Attached Thumbnails Attached Thumbnails screen.gif  
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580

    file name

    com.mdb

    or com2.mdb....


    hmmmmm

  3. #3
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580

    Red face hmmm

    maybe spaces in folder name?

  4. #4
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    thats what i was affraid of, that it something i cant change i only code i don't admin the network
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  5. #5
    Join Date
    Jun 2002
    Location
    Toronto, Canada
    Posts
    7
    Try putting extra double quotes around the names. In a similar situation I had problems getting VBA to accept code to automatically open a database.

    stAppName = "C:\Program Files\Microsoft Office\Office\msaccess.exe ""G:\SCS Excess Inventory\Admin.mdb"""

    Notice the extra quotes I had to put around the 2nd part of the string? Fiddle around and see what you come up with.

    HTH,

    DT

  6. #6
    Join Date
    Nov 2002
    Location
    USA
    Posts
    2
    Well, sometimes I've noticed spaces in filenames cause all sorts of problems, what happens if you use the URL equivelency of a space and see if the computer is smart enough to pick it up...?

    %20 = space in URL formatting.

    DAO.DBEngine.CompactDatabase "J:\MICHAEL%20TIMONEY\com.mdb", "J:\MICHAEL%20TIMONEY\com2.mdb"

  7. #7
    Join Date
    Nov 2002
    Location
    Kansas City, MO
    Posts
    2
    You can also use the short file name instead of the long file name. Open a command prompt, go to the J: drive and do a dir /X. That will display the 8.3 file name.

Posting Permissions

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