Path

Solved
patron224 Posted messages 8 Status Member -  
patron224 Posted messages 8 Status Member -
Hello! I would like to use a relative path to read an .mp3 file.
With the absolute path:
Windowsmediaplayer.URL="E:\mes bases\boutique\audio.mp3" it works, but when I copy the boutique directory along with the .mp3 file to another PC, it doesn't work.
I would like to know if there is a relative path to solve this problem.
Thank you

2 answers

  1. yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   Ambassadeur 1 588
     
    Hello,
    is the mp3 file in the same directory as the Access database? Well, that's easy!
    by using, for example,
    CurrentDb.Name
    , or even better,
    CurrentProject.Path
    0
  2. patron224 Posted messages 8 Status Member
     
    Thank you.
    But I would like to know how to use "currentDb.Name" or currentProject.path
    0
    1. yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   1 588
       
      Is the mp3 file in the same directory as the Access database?
      Did you understand what
      currentProject.path
      was? Did you display its value?
      Did you understand the principle of the relative path?
      0
    2. patron224 Posted messages 8 Status Member > yg_be Posted messages 23437 Registration date   Status Contributor Last intervention  
       
      The .mp3 file is in the same directory as the database.
      I do not know what "currentProject.Path" is.
      I understand the principle of relative paths (the path to reach an object from the current directory).
      Referring to this absolute path: "E:\my databases\shop\audio.mp3". Knowing that my current directory is "shop", what relative path can we take?
      Thank you for helping me further.
      0
    3. yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   1 588 > patron224 Posted messages 8 Status Member
       
      Did you display the value of currentProject.path?
      0
    4. patron224 Posted messages 8 Status Member > yg_be Posted messages 23437 Registration date   Status Contributor Last intervention  
       
      No, I haven't displayed its value. I don't even know how to use this function.
      0
    5. yg_be Posted messages 23437 Registration date   Status Contributor Last intervention   1 588 > patron224 Posted messages 8 Status Member
       

      msgbox currentProject.path
      0