Results 1 to 10 of 10
  1. #1
    bamia is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2020
    Posts
    7

    Change folder location of database

    Hello,



    I have a very old database that I copied to use for something else and would like to rename it and move it to another folder. I really do not have to do that but it pissing me off that something as simple as changing the database name and the name of the folder turns out to be a complete nightmare.

    WindowsXP on vritualbox
    Microsoft access 2007


    So I have a database "mydatabse.mdb" and it works just fantastic for as long as it is in folder "C:/my folder" if I change to folder name or move it to anywhere other than C:/ I get error attached.

    I tried changing default folder location but that did not help.

    How do I change the folder name or location.

    Thanks
    Attached Thumbnails Attached Thumbnails microcrap.PNG  

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    That message usually means a reference is missing or broken, but if you're copying the db from one place to another, that doesn't make sense - unless maybe you're copying to a different pc. Then it would make sense as a possibility. Might help if you specified what you're doing when you raise that error.

    IIRC, also possible to raise that error when event code becomes 'disconnected' from a control. That is usually fixed by clicking on the event in the property sheet for that control and if it takes you to that code it can re-establish the connection. A decompile then re-compile is sometimes another fix for disconnected code.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    bamia is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2020
    Posts
    7
    It is on the same disk and in the same folder, I just renamed the folder, that's it. Something in the database is linked to that specific location that changing the folder name produces that error.

    I have a form Switchboard that loads when I open access with that database and on the form there are several buttons with click even to launch other forms. When I click the button the errors shows up. But again only if I change the folder name, if I leave it with the old name everything works just fine.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Then there must be code on a form that contains a hard coded path value that you're breaking by changing the location path. Examine all the event codes and look for any hard coded path values. Or you could post a copy of the db that you compact and zip.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    bamia is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2020
    Posts
    7
    Quote Originally Posted by Micron View Post
    Then there must be code on a form that contains a hard coded path value that you're breaking by changing the location path. Examine all the event codes and look for any hard coded path values. Or you could post a copy of the db that you compact and zip.

    OK, some more information. I made this DB about seventeen years ago in 2003 version and haven't worked with access much for at least 12 years, so everything is fogy.

    There are three DBs, MyMainDB, DB1 and DB2 . MYMainDB is the main DB that I launch with forms to create invoices and quotations, etc. The other two DBs have inventory control and customer contact information. So I changed the link tables in all three DBs already before focusing on this last unresolved issue.

    So, back to this error. I launch MyMainDB and click on a button to launch a form and that's when I get the error. That we know.
    So I launched DB1 (and DB2) to have a look at it and realized that it also not working properly, the form that displays when the DB is launched doesn't have all the button on the form, it shows only one button and when I click on it I get the same error. But when I change the folder name back (and of course re-link all the tables) and re-launch DB1 (or DB2) the rest of the buttons show up and of course clicking them does not cause and error.

  6. #6
    bamia is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2020
    Posts
    7
    OK I found it but don't know how to fix it.
    The path is hard coded :

    Code:
    Dim stAppName As String
    
        stAppName = "C:\MyMainFolder\Folder1\DB1.mdb"
        Call Shell(stAppName, 1)
    So I changed that path but still have the same problem which means it must be codes in other places. How to I search the entire code.
    I Opened VB and a specific from and click on the hour glass but not matter what I do for options it still searches only the code of the current form

  7. #7
    bamia is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2020
    Posts
    7
    OK, That wasn't it.

  8. #8
    CarlettoFed is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    257
    If you attach a copy of the databases, devoid of any sensitive data, perhaps we can try to help you.

  9. #9
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    In vb editor, ctrl+F launches Find. Set option to search entire code project for
    C:\MyMainFolder

    You are on the right path but it could also be related to queries not being able to connect to the specified tables. Not sure what you are doing around that. As long as the table names remain the same, it won't matter where the back end is as far as the queries are concerned. If you're linking to other tables and queries are looking for them, then you have that issue too.

    Best to lookup paths in a table AFAIC. That way you can edit the table data to suit different locations. Or use relative paths in code. If you want to post a copy as suggested, you could always try this to conceal data
    https://www.accessforums.net/showthread.php?t=77482
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #10
    bamia is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2020
    Posts
    7
    Thanks everyone I decided to let it go as I was able to get it working on Windows 7 Access Version 2013 which is a much better option and tool a lot less time to fix the code that trying to figure out why it didn't work on XP.

    But, my conclusion based on the fact that I changed DB location very easily on 2013 is that it has something to do with XP folder option, user permission and all that jazz.


    Thanks again.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Database Location change
    By Srin in forum Access
    Replies: 5
    Last Post: 12-22-2020, 12:19 AM
  2. Replies: 11
    Last Post: 02-25-2019, 02:09 PM
  3. Create a folder into a network location
    By charly.csh in forum Access
    Replies: 7
    Last Post: 12-04-2015, 10:02 AM
  4. Change Primary Location of Access Database
    By MichaelWR90 in forum Access
    Replies: 8
    Last Post: 06-03-2013, 09:45 AM
  5. Replies: 0
    Last Post: 03-01-2011, 10:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums