Relative Path

  • Thread starter Thread starter blitzn
  • Start date Start date
B

blitzn

I have a Access 2007 Database (mdb) stored in the path C:\LAS\App_Data
I want a relative reference to images stored in the path C:\LAS\Images

I've tried "..\LAS\Images", "..\..\LAS\Images", "~\LAS\Images" to name a
few. I also tried the Application.CurrentProject.Path function - but this of
course returned "C:\LAS\App_Data".

I can't seem to find any help on this.

Thanks in advance for any thoughts.....
 
I haven't tried it but it came from a kb post from ms


Private Sub fnFolderParentFolderVB()
Dim objShell As Shell
Dim objFolder As Folder
Dim ssfPROGRAMS As Long

ssfPROGRAMS = 2
Set objShell = New Shell
Set objFolder = objShell.NameSpace(ssfPROGRAMS)
If (Not objFolder Is Nothing) Then
Dim objParentFolder As Folder

Set objParentFolder = objFolder.ParentFolder
If (Not objParentFolder Is Nothing) Then
Debug.Print objParentFolder.Title
End If
Set objParentFolder = Nothing
End If
Set objFolder = Nothing
Set objShell = Nothing
End Sub


http://msdn.microsoft.com/en-us/library/bb787880(VS.85).aspx


hth

--
Jack Leach
www.tristatemachine.com

- "Success is the ability to go from one failure to another with no loss of
enthusiasm." - Sir Winston Churchill
 
blitzn said:
I have a Access 2007 Database (mdb) stored in the path C:\LAS\App_Data
I want a relative reference to images stored in the path C:\LAS\Images

I've tried "..\LAS\Images", "..\..\LAS\Images", "~\LAS\Images" to name a
few. I also tried the Application.CurrentProject.Path function - but this
of
course returned "C:\LAS\App_Data".

I can't seem to find any help on this.

Thanks in advance for any thoughts.....

Use the CurDir function and you'll probably find that the path is not what
you expect. To ensure a correct relative path, change directory first. You
can use the ChDir statement for that:

ChDir "C:\LAS\App_Data"

Then:

...\Images

should work fine.
 
Thank you, You were right the path was different than expected and this
solved my issue.

Cheers and Thanks Again!
 
Back
Top